Question about apache and mod_expires

John Shaver bobjohnbob at gmail.com
Mon Aug 29 18:50:25 MDT 2011


a refresh will often-times cause the browser to override the cache.
Instead, open the page again in a new tab.  Also, consider using dev tools
in chrome to test instead of putting up a new image every time( the network
tab I think)

On Aug 29, 2011 6:19 PM, "Victor Villa" <vvilla at gmail.com> wrote:

I've enabled mod_expires, and according to the tutorial, it seems to check
out.  I get an expiration date on all my files like i'd hope. The problem is
that when I navigate to a page, and it loads images, it doesn't seem to pull
from cache, it seems to be querying the server regardless.

System Specs:
Centos 5.5
Apache 2.2.3

Test:
navigate to webpage which has images.  change one of the images that is on
the web page.  reload the page (either by closing the browser and going to
the URL directly, or pressing the refresh button), new image loads.
 shouldn't the old image load??

tuts i referenced:
http://httpd.apache.org/docs/2.0/mod/mod_expires.html
http://www.howtoforge.com/make-browsers-cache-static-files-with-mod_expires-on-apache2-debian-squeeze

conf:
NameVirtualHost 192.168.0.34:80
<VirtualHost 192.168.0.34:80>
ServerName www.example.com
DocumentRoot /var/www/html
ServerAdmin webmaster at example.com

<IfModule mod_expires.c>
         ExpiresActive on

         ExpiresDefault "access plus 1 day"

         ExpiresByType image/jpg  "access plus 1 day"
         ExpiresByType image/png  "access plus 1 day"
         ExpiresByType image/gif  "access plus 1 day"
         ExpiresByType image/jpeg  "access plus 1 day"

         ExpiresByType text/css "access plus 1 week"

         ExpiresByType image/x-icon "access plus 1 month"

         ExpiresByType text/javascript "access plus 1 week"
         ExpiresByType application/x-javascript "access plus 1 week"
         ExpiresByType application/javascript "access plus 1 week"
</IfModule>

</VirtualHost>

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/


More information about the PLUG mailing list