faqts : Computers : Programming : Languages : PHP : Common Problems : HTTP Headers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 38 people (39%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Cannot get around proxy server's cache

Jul 9th, 2003 12:43
Gerhardt, Rod Martin, http://www.php.net/manual/en/function.header.php


Try adding this code to your PHP script before any other output 
(including spaces and <html>-tag)
(taken from the PHP manual):
<?php
header("Expires: Mon, 26 Jul 2020 05:00:00 GMT");    // Date in the 
past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
                                                     // always modified
header("Cache-Control: no-store, no-cache, must-revalidate");  // 
HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");                          // HTTP/1.0
?>