|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Does anyone know of a way to unset a header? I have an Expires: header
that I believe Apache is setting, and I don't want it. Thanks. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> Try this never gives me a problem. I use it to keep proxy servers from
> caching. > > <? > header("HTTP/1.1 200 OK"); > header("Status: 200 OK"); > header("Expires: Mon, 26 Jul 1997 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-cache, must-revalidate"); // > HTTP/1.1 > header("Pragma: no-cache"); > // HTTP/1.0 > ?> Yes but I want to unset an Expires: header and not give a any value. 1. PHP (I believe) is setting an Expires: header. 2. The Expires: header is causing the page to be cached too long, Longer than the Last-Modified: header would allow. 3. Setting the Expires: header to garbage, eg: Expires: none causes no caching to occur at all. Let me reiterate, I want this page to get cached, but not based on an Expires: header. Rather a Last-Modified header. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> Let me reiterate, I want this page to get cached, but not based on an
> Expires: header. Rather a Last-Modified header. Have you tried setting the value to FALSE, NULL, or something else? I recall having read something along those lines. I'll see if I can find it again, meanwhile you could experiment a little. Regards |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Try this never gives me a problem. I use it to keep proxy servers from
caching. <? header("HTTP/1.1 200 OK"); header("Status: 200 OK"); header("Expires: Mon, 26 Jul 1997 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-cache, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); // HTTP/1.0 ?> Richard L. Buskirk -----Original Message----- From: Richard Heyes [mailto:richardh@phpguru.org] Sent: Sunday, October 21, 2007 7:55 AM To: PHP General List Subject: [php] Unsetting a header Does anyone know of a way to unset a header? I have an Expires: header that I believe Apache is setting, and I don't want it. Thanks. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
admin@buskirkgraphics.com wrote:
> Try this never gives me a problem. I use it to keep proxy servers from > caching. But I want the page to be cached... -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
> Have you tried setting the value to FALSE, NULL, or something else?
Yes, nada I'm afraid. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Richard Heyes wrote:
> admin@buskirkgraphics.com wrote: >> Try this never gives me a problem. I use it to keep proxy servers from >> caching. > > But I want the page to be cached... Maybe I'm being dense, but why not set it to what you want it to be? Clearing it is leaving the decision up to the browser which will not necessarily have the effect you want for all users. Incidentally, it might not be possible if Apache is setting it. Not sure if PHP has the ability to override headers being sent by Apache. -Stut -- http://stut.net/ |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
> Maybe I'm being dense, but why not set it to what you want it to be?
> Clearing it is leaving the decision up to the browser which will not > necessarily have the effect you want for all users. > > Incidentally, it might not be possible if Apache is setting it. Not sure > if PHP has the ability to override headers being sent by Apache. The two have different effects. The Expires: header proclaims that the page is good for x hours/minutes/days etc. Whereas the browser can use the Last-Modified header to figure the staleness for itself. If its newer than the copy it has, it needs to download the newer copy. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
![]() |
| Outils de la discussion | |
|
|