Forum Moderators: coopster
the data of the generated JS, could be -easily- get used for the next 3 days by the visitor.
what headers should i use in order to accomplish that? this are my actual headers:
header('Expires: '.gmdate('D, d M Y H:i:s',time()+(60*60*24*3)).' GMT');
header('Content-type: application/x-javascript');
cache-control and Last-Modified as they will also aid you in this. Hypertext Transfer Protocol [faqs.org]
(the style codes aren't working, at least in preview mode, so I'm leaving the formatting alone)
// send the requisite header information and character set
header ("content-type: application/x-javascript;");
// check cached credentials and reprocess accordingly
header ("cache-control: must-revalidate");
// set variable for duration of cached content
$offset = 60 * 60 * 72; //sec:min:hrs you said 3 days, right?
// set variable specifying format of expiration header
$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
// send cache expiration header to the client broswer
header ($expire);
That would probably do the job. Don't know who originally wrote this, it's found on several sites.
ta