【发布时间】:2017-11-18 11:41:46
【问题描述】:
我的网站是 www.suresafety.com,它位于 magento 1.9.2.0 中。从过去 1.5 年开始它运行良好,但从过去 2 个月开始,它太慢了。里面有1400种产品。
它的速度洞察力在 1 年前是 83。现在是 39 对我们的电子商务不利。
我已完成以下所有步骤:
1) 合并 CSS 和 JS 文件 • 在 Magento Admin 中,转到系统 > 配置 > 开发人员。 • 在“Javascript 设置”下,将“合并Javascript 文件”更改为“是”。 • 在“CSS 设置”下,将“合并 CSS 文件”更改为“是”。 • 清除缓存。
2) 启用平面目录
• 在 Magento Admin 中,转到系统 > 配置 > 目录。 • 在“前端”下,将“使用平面目录类别”更改为“是”。 • 在“前端”下,将“使用平面目录产品”更改为是。 (选修的) • 清除缓存。
3) 确保带有 deflate 压缩规则的部分没有被注释以启用默认压缩规则。
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# 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
4) 添加图片、js、css(.htcaccess)的过期时间
##for image test
<IfModule mod_expires.c>
ExpiresActive On<br/>
ExpiresByType image/jpg "access 1 year"<br/>
ExpiresByType image/jpeg "access 1 year"<br/>
ExpiresByType image/gif "access 1 year"<br/>
ExpiresByType image/png "access 1 year"<br/>
ExpiresByType text/css "access 1 month"<br/>
ExpiresByType text/html "access 1 month"<br/>
ExpiresByType application/pdf "access 1 month"<br/>
ExpiresByType text/x-javascript "access 1 month"<br/>
ExpiresByType application/x-shockwave-flash "access 1 month"<br/>
ExpiresByType image/x-icon "access 1 year"<br/>
ExpiresDefault "access 1 month"<br/>
</IfModule><br/>
5) Cpanel -> 优化网站 -> tic on 2nd option(压缩所有内容)
6) 从页面洞察中下载优化的图片、css、js(底部)
7) 用旧的替换。
【问题讨论】:
-
在tools.pingdom.com 中检查您的网站。我检查了你的网站,加载需要 50 秒,登陆页面大小 2.4mb,大量不需要的重定向和缺少图像文件路径。