【问题标题】:How To increase the speed of magento websites如何提高magento网站的速度
【发布时间】:2014-07-23 16:28:11
【问题描述】:

我使用了一些技巧,例如磁力捕捉功能,禁用未使用的模块,合并 css 和 javascript,禁用系统日志。

所以请告诉我我还能做些什么来提高速度。

【问题讨论】:

    标签: mysql performance .htaccess magento


    【解决方案1】:

    .htaccess 文件中有设置

    <ifmodule mod_deflate.c>
    ############################################
    ## enable apache served files compression
    ## http://developer.yahoo.com/performance/rules.html#gzip
    # Insert filter
    SetOutputFilter DEFLATE
    # 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>
    
    <IfModule mod_headers.c>
       Header set Connection keep-alive
    </IfModule>
    
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 1 year"
    </IfModule>
    ## EXPIRES CACHING ##
    
    FileETag none
    Header unset Cookie  
    Header unset Set-Cookie
    
    <FilesMatch "!\.(gif|jpe?g|png)$">
        php_value session.cookie_domain example.com
    </FilesMatch>
    

    我认为这会对你有所帮助

    【讨论】:

    • 完美解决方案。几乎没有要求我的网站就尝试了你的答案,结果令人惊叹......如果可能的话,我想给你的答案+10,这是不可能的。所以到目前为止只有 +1.. ;)
    【解决方案2】:

    您可以通过以下步骤进行 Magento 优化:

    1. 高性能专用服务器。例如:Amazon EC2 云
    2. 将 Apache 换成 NGINX
    3. 尽量减少 Javascript 的使用
    4. 缩小和压缩 CSS 文件
    5. “组合 CSS”旨在减少由 浏览器
    6. 优化图片
    7. 对图片使用延迟加载
    8. 指定图片尺寸
    9. 将图像组合成 CSS 精灵
    10. 使用内容交付网络 (CDN) 交付静态文件 比如 JS、CSS 和图像来卸载你的服务器
    11. 禁用不需要的模块/扩展
    12. 启用所有 Magento 缓存
    13. 使用整页缓存/清漆缓存/Memcache/RedisCache
    14. 如果你真的不需要,不要使用分层导航,它需要 很多资源
    15. 启用编译
    16. 限制产品概览页面上的产品数量。
    17. 仅将那些属性前端属性设置为“是” 其实打算用。将所有其他设置为“否”。
    18. 请勿用于快速搜索、高级搜索比较等:目录 -> 属性 -> 管理属性 -> 前端属性。
    19. 安装 Google Page Speed 模块
    20. 最小化重定向 – 最小化从一个 URL 到 另一个缩短了用户的等待时间。
    21. 首选异步资源 - 异步获取资源 防止这些资源阻塞页面加载。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-29
      • 2014-07-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多