magento -- 尝试使用squid来缓存html页面来提升magento网站的速度
2010-06-02 12:14
549 查看
使用squid代理服务器可以缓存服务器上经常请求页面的HTML代码.如果把它作为反射代理,可以提高网站的访问速度.在网上搜索了很多资料,打算一一做个试验:
安装squid.
如果只想允许对.html页面进行缓存,把下面的这几行注释去掉
去除动态页面的缓存,比如支付页面,肯定是不能缓存的了.
acl CHECKOUT url_regex ^http://www.sitename.com/checkout$
cache deny CHECKOUT
cache_peer_access myAccel allow our_sites
cache_peer_access myAccel deny all
#save and restart squid and httpd
...........
参考:
http://www.magentocommerce.com/group/blog/action/viewpost/1080/group/168
安装squid.
yum install squid (on redhat machine) #configured apache server to serve magento site on port 81 instead of 80
配置apache侦听81端口,因为当我们配置好之后,apache并不对外直接提供浏览服务,而是由squid来提供.所以下面我们要设置squid侦听80端口,来接受传过来的请求. #now configured squid to serve on port 80 # under /etc/squid/squid.conf, added following lines above http_access settings http_port 80 accel defaultsite=www.sitename.com cache_peer 1.1.1.1 parent 81 0 no-query originserver name=myAccel acl our_sites dstdomain www.sitename.com http_access allow our_sites
#if you want to allow only .html to be cached, un-comment below lines #acl HTML url_regex .html$ #cache allow HTML #cache deny all # to remove caching on checkout page, add wishlist page in case if it doesnt need caching
如果只想允许对.html页面进行缓存,把下面的这几行注释去掉
去除动态页面的缓存,比如支付页面,肯定是不能缓存的了.
acl CHECKOUT url_regex ^http://www.sitename.com/checkout$
cache deny CHECKOUT
cache_peer_access myAccel allow our_sites
cache_peer_access myAccel deny all
#save and restart squid and httpd
...........
参考:
http://www.magentocommerce.com/group/blog/action/viewpost/1080/group/168
相关文章推荐
- 使用 Nginx 提升网站访问速度
- Apache 使用gzip、deflate 压缩页面加快网站访问速度
- javaEE01-使用很HTML的排版标签编写“网站信息页面”,使用图片标签编写“图面显示页面”,使用列表标签编写“友情链接页面”,使用表格标签编写“首页”,框架标签表现“后台页面”
- html页面不使用缓存的代码
- Asp.net mvc 网站之速度优化 -- 页面缓存
- 技术干货:使用静态缓存提升网站性能的五种方法!
- Asp.net mvc 网站之速度优化 -- 页面缓存
- 提升网站页面打开速度的12个建议
- 使用java的html解析器jsoup和jQuery实现一个自动重复抓取任意网站页面指定元素的...
- 使用 Nginx 提升网站访问速度
- 使用 Nginx 提升网站访问速度
- 使用Map作为缓存,提升程序运行速度
- Ubuntu使用命令刷新DNS缓存提高网站访问速度
- 使用 Nginx 提升网站访问速度
- 使用 Nginx 提升网站访问速度
- Magento操作Cookie 并且使用观察者&事件来禁用单页面全页缓存(EE FPC)
- Linux使用指令释放缓存提升系统运行速度的方法
- 使用 Nginx 提升网站访问速度
- Asp.net mvc 网站之速度优化 -- 页面缓存
- 使用 Nginx 提升网站访问速度