Tech Journal Back to Tech Journal

How can I specify that a webpage expires in 24 hours?

To expire a page in 24 hours, use in PHP:
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 24*3600) . " GMT");

This way the cache of a browser won't try to re-download it for a day, unless the user insists.

Last updated on 2007-07-16 03:44:47 -0700, by Shalom Craimer

Back to Tech Journal