: Why is my website cached so aggressively? Whenever I update my website by uploading a new index.html or index.php, it always takes a long time (e.g. hours or days) for that change to propagate
Whenever I update my website by uploading a new index.html or index.php, it always takes a long time (e.g. hours or days) for that change to propagate to my browser.
Even when I hit F5, I still get the old page loaded (quite fast too), so I'm guessing that it's being cached somewhere.
The problem happens in Firefox and Chrome.
Currently I get around this by using a different access URL every time (e.g. every time I make a change, I enter my URL as example.com/?a=43784 with a different random number every time.)
What's the correct solution to this problem? (For example, I can't imagine a news website would be very useful if people's computers/browsers cached the results for hours/days)
More posts by @Sue5673885
3 Comments
Sorted by latest first Latest Oldest Best
If you're using chrome I like to switch to developer mode and then hold down the reload button next to the URL bar and it will present you with a few different options for reloading the page.
Cache-Control and Expires headers can be used to indicate that specific elements need to be cached for longer or shorter periods.
Typically, you want images and other objects to have a far-future expiration for network efficiency and more dynamic content to have shorter expiration or no caching at all.
Probably your website is too optimized for speed. If your server uses Apache you can change the default config by adding an .htaccess file with the configuration that works for you.
There are many web pages on the Internet that can help you on this task, like for example: www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html
Please note that some Apache servers have the .htaccess file disabled, and in that case it will not work.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.