note 124753 added to function.header
| From: | AngelicaPerduta@php.net | Date: | Mon, 24 Feb 2020 23:20:50 +0000 |
| Subject: | note 124753 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214217@lists.php.net to get a copy of this message | ||
I made a script that generates an optimized image for use on web pages using a 404 script to resize
and reduce original images, but on some servers it was generating the image but then not using it
due to some kind of cache somewhere of the 404 status. I managed to get it to work with the
following and although I don't quite understand it, I hope my posting here does help others
with similar issues:
header_remove();
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// ... and then try redirecting
// 201 = The request has been fulfilled, resulting in the creation of a new resource however
it's still not loading
// 302 "moved temporarily" does seems to load it!
header("location:$dst", FALSE, 302); // redirect to the file now we have it
----
Server IP: 45.112.84.4
Probable Submitter: 38.142.137.34 (proxied: 115.189.96.42)
----
Manual Page -- http://php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/124753
Del: integrated -- https://master.php.net/note/delete/124753/integrated
Del: useless -- https://master.php.net/note/delete/124753/useless
Del: bad code -- https://master.php.net/note/delete/124753/bad+code
Del: spam -- https://master.php.net/note/delete/124753/spam
Del: non-english -- https://master.php.net/note/delete/124753/non-english
Del: in docs -- https://master.php.net/note/delete/124753/in+docs
Del: other reasons-- https://master.php.net/note/delete/124753
Reject -- https://master.php.net/note/reject/124753
Search -- https://master.php.net/manage/user-notes.php