Current time: 11-28-2020, 04:31 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistent results? Testing MySQL?
03-26-2011, 04:18 AM
Post: #6
RE: Inconsistent results? Testing MySQL?
Quote:For the expires, I'd steer away from the .htaccess from your friend. I'm pretty sure the must-revalidate will pretty much defeat the purpose, and it does the matching based on file extension. If file extensions are good enough for you then removing the must-revalidate would get you there (though I generally prefer to use Expires in place of cache-control, either is fine).

Thanks, Pat. So would you recommend I use the more "extensive" code I quoted above? It looks like that code uses both Expires and cache-control.

Quote:Turning on caching is the easier part though - make sure you're prepared for the consequences before you do because once you turn it on the files will be stored on the user's computers and the only way to update them (change the css for example) is to change the file name and the references to it. The way I do this is to have a constant in one of my global files for the current version of the css (or javascript) files (like $CSS_VER='3'). Then everywhere in the code where the files are referenced I add a ?v=$CSS_VER query parameter to the files. The web server ignores the query parameter and serves up the file but the browsers include it as part of the file name so when they see a new version they download it from the server. People will frown a bit because SOME intermediary proxies will refuse to cache requests with query parameters and they recommend you put the version in the actual path but for me the tradeoff is worth it since it's easier to deal with (no rewrite rules, it just works).

Good tip, thanks Smile
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Inconsistent results? Testing MySQL? - ckelly06 - 03-26-2011 04:18 AM

Forum Jump:

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