Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Header for long-term caching

What header should I send from my server if I want a webpage to be cached for six months?
SOLUTION
Avatar of Rob Siklos
Rob Siklos
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dave4444
dave4444

This should do it:

$off = 15768000;

header("Content-type: image/gif");

header("Expires: " . gmdate("D, d M Y H:i:s", time() + $off) . " GMT");

header("Cache-Control: Public");

header("Pragma: Public");

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial