Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-28-2007, 10:21 PM
Junior Member
 
Join Date: Sep 2007
Posts: 2
Default Problem setting "Expires" header

Hello everyone,

Within an action I send an image to the client. Since the image is not going to change, I would like to set the "Expires" header to a far future date, so that it gets cached by the browser. I set the replace flag to true, as stated in the documentation.

$response = $this->getResponse();
$response->setHeader("Content-Type", "image/jpeg");
$response->setHeader("Expires", "Thu, 15 Apr 2010 20:00:00 GMT", true);
$response->setBody($image);
$response->sendResponse();

When I take a look at the actual response headers, I see:

"Expires: Thu, 19 Nov 1981 08:52:00 GMT, Thu, 15 Apr 2010 20:00:00 GMT"

Here my questions:
(1) Why is the replace header not working? (I experiment the same problem when I try to set the "Cache" header).
(2) Where does the "Thu, 19 Nov 1981 08:52:00 GMT" came from? I never set that one!

I will greatly appreciate any help. Thanks.

Best regards,
Ivan.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-05-2007, 01:38 AM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 122
Default

have you tried clearing the headers first then setting them? Just a thought...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-05-2007, 07:14 AM
Junior Member
 
Join Date: Sep 2007
Posts: 2
Default

Yes, I tried using clearHeaders(), but it doesn't seem to work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:32 AM.