我的.htaccess文件:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2678400 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType image/gif "access plus 2678400 seconds"
ExpiresByType image/jpeg "access plus 2678400 seconds"
ExpiresByType image/png "access plus 2678400 seconds"
ExpiresByType text/css "access plus 750000 seconds"
ExpiresByType text/javascript "access plus 2678400 seconds"
ExpiresByType application/x-javascript "access plus 2678400 seconds"
</ifmodule>
# Cache Headers
<ifmodule mod_headers.c>
# Cache specified files for 31 days
<filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Cache-Control "max-age=2678400, public"
</filesmatch>
# Cache HTML files for a couple hours
<filesmatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</filesmatch>
# Cache PDFs for a day
<filesmatch "\.(pdf)$">
Header set Cache-Control "max-age=86400, public"
</filesmatch>
# Cache Javascripts for 31 days
<filesmatch "\.(js)$">
Header set Cache-Control "max-age=2678400, private"
</filesmatch>
</ifmodule>
www.gtmetrix.com接受我的杠杆浏览器缓存,但谷歌页面速度不接受该文件:
https://apis.google.com/js/api.js (30 dakika)
https://apis.google.com/js/platform.js (30 dakika)
http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js (60 dakika)
http://pagead2.googlesyndication.com/pagead/osd.js (60 dakika)
https://oauth.googleusercontent.com/…e:rpc:shindig.random:shindig.sha1.js?c=2 (60 dakika)
http://www.google-analytics.com/analytics.js (2 saat)
如何解决此问题。我尝试了缓存插件,如超级缓存,总缓存,快速缓存。但这些都降低了我的谷歌网页速度得分。现在我的谷歌页面速度得分是87/100和gtmetrix 93/100。
我的网站是: www.guzellikperisi.com
答案 0 :(得分:2)
Those scripts are off server, so your .htaccess file does not apply to them - not much you can do.
To be honest, I only use page speeds as suggestions. I never fully rely on page scores. Even if you look at big sites like ign.com or newyorktimes.com they don't have great scores.
Pick and choose what you want to improve. Yes it's good to strive for perfection, but it just depends on your site.