Forum Moderators: phranque
I've tried a lot of combinations of headers with etag, cache-control, expires but still Google Chrome is not caching files (jpg jpeg gif png js css etc...).
Apache is not sending last-modified, content-type and content-lenght headers for images and css js files from web pages, that's mean it sends but only when you enter directly to the file (like xx.com/xx.jpg), not sending from html pages (checked at Firebug, also other sites look sending fine at Firebug).
What do i must do to send headers for last-modified content-type and content-lenght? (I think because of those, Chrome is not caching images and depency files.)
[edited by: Seregwethrin at 7:36 pm (utc) on Dec. 9, 2008]
I'm the server's owner, I've access httpd.conf and all other files
I've those lines and changed them, commented some, uncommented some but couldn't get any successful result.
<FilesMatch "\.(ico如df夸pg夸peg如ng夙if夸s圭ss存wf圩lv)$">
#ExpiresActive On
#ExpiresDefault "access plus 1 day"
Header unset Pragma
Header unset ETag
FileETag None
#Header unset Last-Modified
Header set Cache-Control "public, max-age=86400"
</FilesMatch>
[edited by: Seregwethrin at 7:55 pm (utc) on Dec. 9, 2008]
# Set up Cache Control headers# Activate mod_expires
ExpiresActive On
<FilesMatch "\.(gif夸pe?g如ng夷co圭ss夸s存wf圩lv如df)$">
# Set expiry at 30 days after access
ExpiresDefault A2592000
# Remove cache-control headers (use default client behavior)
Header unset Cache-Control:
# Remove host's default 'Vary: User-Agent' response header
Header unset Vary:
</FilesMatch>
The resulting relevant server response headers for a .gif image request are:
HTTP/1.x 200 OK
Date: Tue, 09 Dec 2008 20:22:13 GMT
Server: Apache
Cache-Control: max-age=2592000
Expires: Thu, 08 Jan 2009 20:22:13 GMT
Last-Modified: Wed, 20 Dec 2006 23:52:40 GMT
Etag: "3647960-14b5-4589ccc8"
Accept-Ranges: bytes
Content-Length: 5301
Content-Type: image/gif
Jim