如何在 wordpress pagespeed insight 中解决利用浏览器缓存

How to solve Leverage browser caching in wordpress pagespeed insight

我正在努力解决杠杆浏览器缓存问题。我已尽我所能,但没有成功。可能是我没有朝着正确的方向努力。

我在godaddy服务器上,我无法安装w3 total cache插件来解决此类问题。

我收到这个:

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 插件!非常有效!如果它们不在服务器内,则您无能为力。 (它们是链接到您网站的外部来源).htacess 规则无法解决这些问题!祝你好运!

约翰

我建议您使用 wpsupercache。一些提供商会阻止缓存插件。我建议你看看他们的博客或 statemens。你可以使用的 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>