【问题标题】:How to speed up magento site?如何加快magento网站的速度?
【发布时间】: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,大量不需要的重定向和缺少图像文件路径。

标签: magento web pagespeed


【解决方案1】:

你已经应用了大部分东西,但你也可以应用以下几点:-

a- 请安装以下扩展:-

https://github.com/GordonLesti/Lesti_Fpc

https://github.com/tinify/magento1-plugin

b-http://magento2x.com/optimize-magento-database-by-cleaning-log/

c-请改进您的服务器配置,例如将内存限制设置为 1024M(可选)

d- 安装和使用 Memcache/varnish 缓存(可选)

e- 您可以使用专用服务器。

【讨论】:

    【解决方案2】:

    Firebug 找出您的网站运行缓慢的原因。

    【讨论】:

      【解决方案3】:

      查看以下网址进行速度优化:

      https://www.keycdn.com/blog/speed-up-magento/

      数据库优化如下:

      SET FOREIGN_KEY_CHECKS=0;

      ALTER TABLE log_url AUTO_INCREMENT=1;

      ALTER TABLE log_url_infoAUTO_INCREMENT=1;

      ALTER TABLE log_visitor AUTO_INCREMENT=1;

      ALTER TABLE log_visitor_info AUTO_INCREMENT=1;

      ALTER TABLE report_eventAUTO_INCREMENT=1;

      ALTER TABLE report_viewed_product_index AUTO_INCREMENT=1;

      ALTER TABLE sendfriend_logAUTO_INCREMENT=1;

      SET FOREIGN_KEY_CHECKS=1;

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-10-30
        • 1970-01-01
        • 1970-01-01
        • 2014-07-23
        • 2019-02-15
        • 1970-01-01
        • 1970-01-01
        • 2016-03-18
        相关资源
        最近更新 更多