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.

1 Answer 1


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)

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'
  • I figured it was a local problem, because some of the other users are getting the updated files, but I had to check to make sure that I was doing my best on my side. Thanks for the response.
    – kabuto178
    Mar 10, 2013 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.