简体   繁体   English

加速Wordpress / Woocommerce - WP Super Cache - “利用浏览器缓存”

[英]Speed Up Wordpress/Woocommerce - WP Super Cache - “Leverage Browser Caching”

I'm trying to sort out caching for my website which is a very large eCommerce site over 45,000 products and counting http://comparedeals.net . 我正在尝试为我的网站整理缓存,这是一个非常大的电子商务网站超过45,000种产品,并且计算http://comparedeals.net

I have added a caching plugin wp super cache but the problem is when I test my site at https://tools.pingdom.com the score for browser caching is only 4. https://tools.pingdom.com/#!/dFhyLB/http://comparedeals.net 我添加了一个缓存插件wp超级缓存,但问题是当我在https://tools.pingdom.com上测试我的网站时,浏览器缓存的分数只有4. https://tools.pingdom.com/#!/ dFhyLB / HTTP://comparedeals.net

**4     Leverage browser caching**

The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

    http://comparedeals.net/wp-content/themes/wootique-child/style.css
    http://comparedeals.net/wp-content/themes/wootique/css/reset.css
    http://comparedeals.net/wp-content/themes/wootique/custom.css
    http://comparedeals.net/wp-content/themes/wootique/functions/css/shortcodes.css
    http://comparedeals.net/wp-content/themes/wootique/images/ico-cart-light.png
    http://comparedeals.net/wp-content/themes/wootique/images/ico-search.png
    http://comparedeals.net/wp-content/themes/wootique/styles/default.css
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-5s-16GB-Gold-200x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-5s-16GB-Space-Grey-200x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-6s-16GB-Space-Grey-123x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-SE-16GB-Gold-96x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-SE-16GB-Rose-Gold-97x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-SE-16GB-Silver-96x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Apple-iPhone-SE-16GB-Space-Grey-96x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/HTC-10-32GB-Glacial-Silver-100x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/LG-G5-32GB-Titan-Grey-100x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Samsung-Galaxy-S7-32GB-Black-101x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Samsung-Galaxy-S7-Edge-32GB-Black-98x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/Sony-Xperia-Z5-Black-100x200.png
    http://comparedeals.net/wp-content/uploads/2016/07/comparedeals-logo.png
    http://comparedeals.net/wp-content/uploads/slider2/b3b5017c06a693ceb7a6c5c279a5795d.jpeg
    http://comparedeals.net/wp-content/uploads/slider2/s1.jpeg
    http://comparedeals.net/wp-content/uploads/slider2/upgrade-desktop_v2.jpeg
    http://comparedeals.net/wp-includes/js/thickbox/loadingAnimation.gif
    http://fonts.googleapis.com/css?family=Montserrat:400&subset=latin
    http://fonts.googleapis.com/css?family=Varela+Round%3Aregular

How can I increase my website score for caching using wp super cache, I tried W3 Total cache which increased that score to 94 but my pages slowed down to 60 seconds to load a page. 如何使用wp超级缓存增加我的网站得分缓存,我尝试了W3 Total缓存,将该分数提高到94但我的页面加载速度减慢到60秒加载页面。

I basically just want my website to load as fast as possible any advice please? 我基本上只是想让我的网站尽快加载任何建议吗?

Also my hosting is business level shared bluehost cloud site so I assume I have the necessary resources. 我的托管也是业务级共享bluehost云站点,所以我假设我有必要的资源。

First of all let's separate page cache and browser cache, they are different things. 首先让我们分开页面缓存和浏览器缓存,它们是不同的东西。

W3 Total cache is great plugin but it has a lot of settings and sometimes it's hard to setup it properly(as result your site was slowed down). W3总缓存是一个很棒的插件,但它有很多设置,有时很难正确设置(因此您的网站速度变慢)。

WP Super Cache is less complicated and suitable for most website but it doesn't have browser cache control feature. WP Super Cache不太复杂,适用于大多数网站,但它没有浏览器缓存控制功能。

What I suggest is: Continue using WP Super Cache and setup browser cache manually. 我的建议是:继续使用WP Super Cache并手动设置浏览器缓存。 For this you need to edit your .htaccess file and give expiration to your resources by type. 为此,您需要编辑.htaccess文件并按类型提供资源到期。 I suggest you to read this Optimizing WordPress – Browser Cache article to understand what is browser cache also in article you'll see example of fail-safe .htaccess rules to leverage browser caching, just prepend them to your current .htaccess file. 我建议你阅读这篇优化WordPress - 浏览器缓存文章,了解什么是浏览器缓存,在文章中你会看到利用浏览器缓存的故障安全.htaccess规则的例子,只是将它们添加到你当前的.htaccess文件中。

Note: mod_expires must be enabled on your server(it's usually enabled by default) 注意:必须在服务器上启用mod_expires(默认情况下通常启用它)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM