Current time: 03-04-2021, 04:53 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enable browser caching of static assets
09-28-2011, 10:36 AM
Post: #6
RE: Enable browser caching of static assets
You don't make the users aware of it, it needs to be designed into the site itself. If you are expecting to change css or javascript files then you need to have a system in place where you can change the file name every time you change the contents.

Personally, I do this by having a version number declared in a global file and I bump the version number any time I edit the css or javascript. Anywhere they are included they are included as <file>?v=<version>. The query parameter is just ignored by the web server so the ACTUAL file name can be the same but it's enough to bust the cache.

Purists may comment that the query string may prevent intermediate proxies from caching the content and that you should add the version to the URL itself but it wasn't worth the extra effort for my needs.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Enable browser caching of static assets - pmeenan - 09-28-2011 10:36 AM

Forum Jump:

User(s) browsing this thread: 1 Guest(s)