Some browsers are more aggressive with default caching than others. However, there are cache control headers that you can send to indicate when to reload the code.
header("Expires: " . date("r", time() + ( 60 * 60 * 24 * 7 * 1 ) ) ); // Expires in 1 week header("Content-Type: application/x-javascript");
It is a piece of code that I know is being used.
You can use more interesting things like If-Not-Modified and ETags headers, but expiration times are the only ones that eliminate additional server calls.
Kent Fredric Nov 19 '08 at 8:33 2008-11-19 08:33
source share