Problem with browser cache

91 views
Skip to first unread message

Maciej Grela

unread,
May 27, 2016, 6:31:12 AM5/27/16
to pagespeed-insights-discuss
Hello everyone,
I found a strange problem with one of probably google javascript. The PageSpeed Insights shows me that one of .js isn't using browser cache.

https://stats.g.doubleclick.net/dc.js (2 Hours)

And also, here I leave my .htaccess

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# BEGIN Expire headers
# Makes cached files stay cached for longer (304 Not modified) = fewer 200 responses.
# Aim for at least 1 month for images, ideally a year (not longer - that'll break RFC specs)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/icon "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
ExpiresByType application/x-ico "access 1 year"
ExpiresByType application/ico "access 1 year"
ExpiresByType application/xhtml+xml "access 1 month"
ExpiresByType application/javascript "access 2 months"
ExpiresByType application/x-javascript "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 year"
ExpiresByType text/html "access 1 month"
ExpiresDefault "access 7 days"
</IfModule>
# END Expire headers
 
# BEGIN Cache-Control Headers
# Only using the private/public values here - not max-age (Expires headers cover the same thing, and are more widely supported)
 
Header set Cache-Control "public"
Header set Cache-Control "private"
Header set Cache-Control "private, must-revalidate"
 
# END Cache-Control Headers
 
# BEGIN Turn ETags Off
# Inherently misconfigured, especially for server clusters
 
Header unset ETag
FileETag None
 
# END Turn ETags Off
 
# BEGIN Remove Last-Modified Header
# We're using Expires header to check for freshness, so save bytes by not returning this header.
 
Header unset Last-Modified
 
# END Remove Last-Modified Header



Any suggestions?

Sven Grossenbacher

unread,
Jun 1, 2016, 9:45:57 AM6/1/16
to pagespeed-insights-discuss
It is using browser cache but only 2 Hours... it seems we have no influence to change that as we do not host the script itself... you could probably copy the script and add it to your website and then change the time to cache - but if they update the file it won't be updated on your site. 

I have the same problem - with Google Maps js - Google Analytics js and Doubleclick js... and do not understand why Google complains about its own code...

mr.tharn...@gmail.com

unread,
Jun 23, 2016, 12:50:57 PM6/23/16
to pagespeed-insights-discuss
Reply all
Reply to author
Forward
0 new messages