note 52803 added to function.session-cache-limiter
| From: | snakes at ntica dot com | Date: | Thu, 12 May 2005 21:28:37 +0000 |
| Subject: | note 52803 added to function.session-cache-limiter | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89356@lists.php.net to get a copy of this message | ||
Avoiding caching PHP pages:
After lot of tries and research this is the best combination of headers I've found that seems
to work well even with the proxy of visitors that are using satellit connection.
<?
header("ETag: PUB" . time());
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()-10) . "
GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5) . " GMT");
header("Pragma: no-cache");
header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
session_cache_limiter("nocache");
?>
----
Manual Page -- http://www.php.net/manual/en/function.session-cache-limiter.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52803
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52803&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52803&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52803&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52803&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52803&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52803&report=yes
Search -- http://master.php.net/manage/user-notes.php