note 46846 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:31:03 +0000 |
| Subject: | note 46846 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199172@lists.php.net to get a copy of this message | ||
Note Submitter: guvnor
----
One that tripped me up for a while...
When I use PHP sessions, the following headers are sent automatically to force the browser not to
cache:
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
If you are having trouble with inline PDFs etc., thses may be causing you problems. As per other
notes here if you overwrite these headers before outputting your file, the download problems will go
away.
header('Cache-Control:');
header('Pragma:');
If you wish to retain the dynamic content, only send the above if the document you are returning is
not HTML.
Its well worth examining your own headers (call your PHP script from another script using
get_headers() for instance) before going mad trying to fix something - better still compare the
headers from your script with headers from a static web page - it might save you hours of time.