note 46049 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:31:12 +0000 |
| Subject: | note 46049 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199173@lists.php.net to get a copy of this message | ||
Note Submitter: j dot gizmo at aon dot at
----
some browsers always reload stylesheets, javascripts and other seldomnly changing files, which
causes nasty delays when loading a website (Safari on MacOS is an example)
to tell the browser to keep files in cache for at least a day, you can use
<?php
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . '
GMT');
?>
This has the nice sideeffect of telling other browser that never refresh pages to refresh them at
least once a day.
PS: i figure this is trivial, but it cost me some headache