tendouser Posted June 12, 2011 Share Posted June 12, 2011 I uploaded new pictures to a website I maintain and is hosted in my unlimited web hosting shared hosting account. When I browse this site through Firefox I have to refresh to see the new or edited images; same browsing through IE. How can I prevent this to happen because old cache?? Thanks! Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted June 12, 2011 Share Posted June 12, 2011 it could be cache indeed, something you might want to add in an .htaccess file on your server is the following # Sets the cache control for 1 week <FilesMatch "\.(css|jpg|png|gif|swf|js)$"> Header set Cache-Control "max-age=604800, must-revalidate" </FilesMatch> # turn on the module for this directory ExpiresActive on # set default ExpiresDefault "access plus 24 hours" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType text/css "access plus 1 months" ExpiresByType text/javascript "access plus 1 months" ExpiresByType application/javascript "access plus 1 months" ExpiresByType application/x-shockwave-flash "access plus 1 months" the article on the example given above is: http://www.flingbits.com/tutorial/view/improve-your-sites-performance-with-apache Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.