Some clarifications about cache-control

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
estarapapax
Forum Newbie
Posts: 7
Joined: Fri Feb 20, 2009 12:03 am

Some clarifications about cache-control

Post by estarapapax »

I'm building a website which dynamically creates javascript files. I want these files to be cached by the browser but I want them to always revalidate whether the files are updated since caching or not. These means that I must use "Cache-control: must-revalidate". My questions are: How long will the browser cache the files since I haven't added any max-age there (Actually, I want those files to stay cached until those files were updated)? And how will the browser revalidate whether a file is updated or not? Is it simply looking at the Last modified header information of the file? And if it detected that the Last modified header information predates the time of caching, it will just abort fetching the file?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Some clarifications about cache-control

Post by Benjamin »

How long the browser will cache it for if there is not an expire time depends on how the user has configured the browser.

Here's some good information for you:
http://www.justsoftwaresolutions.co.uk/ ... n-php.html
estarapapax
Forum Newbie
Posts: 7
Joined: Fri Feb 20, 2009 12:03 am

Re: Some clarifications about cache-control

Post by estarapapax »

hey thanks.. this is the tutorial I'm looking for..
Post Reply