I started using https://code.google.com/p/minify/ on my site to decrease the amount of http requests. But google's PageSpeed insights tool is telling me that the new reference link isn't being cached. A example of one of the new links that Minify created is this one:
<link type="text/css" rel="stylesheet" href="/min/f=css/responsee.css,css/components.css,css/animate.css,owl-carousel/owl.theme.css,owl-carousel/owl.carousel.css" />
My htaccess file has caching setup just fine and before I combined the .css files everything was being cached according to Pagespeed. Is this a bug or do I have to add a new line to my htaccess file?
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
# Manifest files
ExpiresByType application/manifest+json "access plus 1 year"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Media files
ExpiresByType audio/ogg "access plus 1 week"
ExpiresByType image/bmp "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/svg+xml "access plus 1 week"
ExpiresByType image/webp "access plus 1 week"
ExpiresByType video/mp4 "access plus 1 week"
ExpiresByType video/ogg "access plus 1 week"
ExpiresByType video/webm "access plus 1 week"
# Web fonts
# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
# OpenType
ExpiresByType font/opentype "access plus 1 month"
# TrueType
ExpiresByType application/x-font-ttf "access plus 1 month"
# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 month"
# Other
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
</IfModule>
EDIT:
Here is the header:
GET /min/f=css/responsee.css,css/components.css,css/animate.css,owl-carousel/owl.theme.css,owl-carousel/owl.carousel.css HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: text/css,*/*;q=0.1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://example.com/
Cookie: PHPSESSID= -removed-;
sc_is_visitor_unique=rx10296953.1429464775.24A3E18F98904F802719FEC9140DFAFF.30.22.19.17.10.6.3.1.1
Connection: keep-alive
If-Modified-Since: Sun, 19 Apr 2015 15:43:07 GMT
If-None-Match: "pub1429458187;gz"
Cache-Control: max-age=0
HTTP/1.1 304 Not Modified
Date: Sun, 19 Apr 2015 17:34:10 GMT
Server: Apache
Connection: Keep-Alive
Keep-Alive: timeout=15, max=99
Etag: "pub1429458187;gz"
Expires: Sun, 19 Apr 2015 18:04:10 GMT
Cache-Control: max-age=1800
Vary: Accept-Encoding,User-Agent
text/cssContent-Type? – MrWhite Apr 19 '15 at 17:01text/csstype but I could be wrong – Crecket Apr 19 '15 at 17:16Content-Typeheader your server is responding with by examining the request/response in the browser. This header works with theExpiresByTypedirective you have in .htaccess. In fact you should be examining the HTTP response headers to see why this resource is not being cached. – MrWhite Apr 19 '15 at 17:24Content-Typeheader in the response). TheCache-Control: max-age=1800header is telling the browser to cache this response for 30 minutes. I would assume this is being set by the Minify script - which will override mod_expires (which will only set the header if it doesn't already exist). – MrWhite Apr 19 '15 at 18:08