如何解决利用wordpress页面速度洞察中的浏览器缓存


How to solve Leverage browser caching in wordpress pagespeed insight

我正在努力解决Leverage浏览器缓存问题。我尽了我所能,但没有成功。也许我的工作方向不对。

我在godaddy服务器上,无法安装w3总缓存插件来解决此类型的问题。

我得到了这个:

http://s.gravatar.com/js/gprofiles.js (expiration not specified)
http://mydomain.netdna-cdn.com/…t-scrollbar-0.4.6.with-mousewheel.min.js (60 minutes)
http://mydomain.netdna-cdn.com/…gins/wp-google-maps/css/wpgmza_style.css (60 minutes)
http://mydomain.netdna-cdn.com/…ins/revslider/rs-plugin/css/settings.css (60 minutes)
http://mydomain.netdna-cdn.com/…/themes/inovado/framework/css/retina.css (60 minutes)
http://mydomain.netdna-cdn.com/…content/plugins/optin-panel/js/script.js (60 minutes)
http://mydomain.netdna-cdn.com/…hemes/inovado/framework/js/mobilemenu.js (60 minutes)
http://www.google-analytics.com/analytics.js (2 hours)

我已经在.htaccess文件中应用了一些代码,并试图通过一些插件来解决这个问题,但没有成功。

请帮助解决此问题—利用wordpress中的浏览器缓存。

感谢

如果这些文件位于您的服务器中,您可以使用:利用浏览器缓存Ninjas插件!它非常有效!如果它们不在服务器中,那么你对此无能为力。(它们是链接到你的网站的外部源).htaccess规则不会解决这些问题!祝你好运

John

我建议您使用wpsupercache。一些提供商确实阻止缓存插件。我建议你看看他们的博客或州政府。你可以使用的Htaccess代码(我也这么做:)

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>