Jump to content

question about browsing


tendouser

Recommended Posts

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!

 

Link to comment
https://forums.phpfreaks.com/topic/239105-question-about-browsing/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.