0

It's about making changes in design (css-files and images) on a website which is already online and in use. I wonder what is the best-practice to make sure that visitors see the changes without clearing there browser's cache manually. Things that came in my mind:

  • change meta-tag - dismissed because I do not want the site to be ALWAYS loaded from the server
  • include the css-file with a parameter (like timestamp) after made a change
  • change the names of included images so that they are reloaded - means also change names in the files where images are included
  • ?

What else could achieve the loading from server? Did I forget some advantages/disadvantages?

32bitfloat
  • 743
  • 2
  • 8
  • 19

1 Answers1

1

Possible duplicate of this post: How to control web page caching, across all browsers?

My favoured solution is to set a random number after you call the file e.g.

css/styles.ccs?628454548

images/sprite.gif?8356484894

You could use javascript/php or whatever to set those random numbers every time the page is called to the browser.

Community
  • 1
  • 1
Billy Moat
  • 19,702
  • 6
  • 42
  • 37
  • Sry I did not found this question. My issue is not about loading the files EVERY TIME, I do want to have files cached by the visitor's browsers in general. I just want to say, after making changes, "now reload the files from the server". So the paramater on image-URLs also works in all browsers? I wasn't that sure. Thanks for your answer. – 32bitfloat Aug 20 '12 at 12:00