: Handling APACHE file caching I have used .htaccess to cache images, css and javascript files on my server for up to a month. My problem is that some users get updates that I made recently
I have used .htaccess to cache images, css and javascript files on my server for up to a month. My problem is that some users get updates that I made recently and all works normally while some user files have not been upgraded to the latest version. For me after changing one of these files and refreshing the page causes the new changes to take effect on my computer but not for some other users. Is there a way to force updating if I made changes to any of these files? Thank you.
More posts by @Sent6035632
1 Comments
Sorted by latest first Latest Oldest Best
The fact that some users are getting the updates and not others, means that the server is most likely sending the new content, but the 'other' users' browsers are probably caching the content. Which means, there's nothing YOU can do about specifically.
Though you can TRY to send these headers (which may help the browser to not cache the content) (in PHP)
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
"Is there a way to force updating if I made changes to any of these files?"
You can try using dynamic filenames, such as 'image003_[timestamp].jpg'
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.