谈下路由建站的速度优化,令人满意

在路由上建站,除了受到路由器本身性能的限制外,影响访问体验的另外一个因素就是网络的上行速度。因此在路由器的性能一定的条件下,只有优化输出文件的大小,才能达到提升浏览体验的目的。下面谈下我的两个优化思路(更加详细的说明见我的博客 www.damuzi.net ):
1. lighttpd优化
opkg install lighttpd-mod-compress 
vi /etc/lighttpd/lighttpd.conf 
找到 server.modules = (    加入   "mod_compress",  以启用compress模块 
找到 #### compress module  加入 
compress.allowed-encodings = ("bzip2", "gzip", "deflate")
compress.cache-dir          = "/mnt/sda1/tmp"
compress.filetype           = ("text/plain", "text/html", "text/css", "text/javascript")
:x 

2. php优化
也需要安装apc模块 zlib模块
zlib.output_compression = On
zlib.output_compression_level = 6 
zlib.output_handler =On
apc.enabled = 1
apc.shm_segments = 1    ;The number of shared memory segments to allocate for th
apc.shm_size = 6M       ;The size of each shared memory segment.
apc.ttl =21600          ;The time of renew the cache.

经过优化后,路由会先压缩要输出的文件,在客户端解压输出,而压缩的效率达到50%以上,大大减少了客户端接收文件的时间,效果非常满意。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值