magento1.9参考:[7]优化网站响应速度
1、使用magento最好使用apache类型的服务器。如果使用IIS服务器的话需要插件才能支持.htaccess文件。首页使用.htaccess利用Cookies你可以使用谷歌网站PageSpeed Insights诊断
2、使用编辑器(dw,notepad++)打开根路径下的.htaccess在最后添加<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">Header set Cache-Control "max-age=2592000"</FilesMatch> >加载后效果图如下优化flash格式swf flv视频 css jpg png 等
3、然后在.htaccess中找到下面相似代码(我这里是去掉了#号的)######拭貉强跳######################################## enab造婷用痃le apache served files compression## # Insert filter on all content SetOutputFilter DEFLATE # Insert filter on selected content types only #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary</IfModule>另外一个要修改地方(同样也是去掉php_flag zlib.output_compression前面#号)############################################## enable resulting html compression php_flag zlib.output_compression on
4、使用System -> Tools -> Compilation然后选 Run Compilation Process, 几分钟之后会出现 Compilation Successfully finished 就完成了。如果使用有问题,只需在同一页面下选 Disable就可以了。
5、然后去magento下载插件magentocommerce.com/magento-connect/搜索Lesti_Fpc注册获取此插件地记醋弭床址。登录后台选择system-manage connect-magento connect manager,然后输入你的后台帐号和密码,Paste extension key to install后面的输入框中放入你的插件地址,点击install,下面会有新出现你插件介绍(注:若不会使用请关注系列教程之8介绍此处用法),然后选择process等待完成,返回后台.
6、在后台选择system-Cache Management-然后如图所示操作即可