Changing the reponse headers & Firefox

0 views
Skip to first unread message

mermer

unread,
Feb 16, 2009, 9:41:29 AM2/16/09
to Django users
I am trying to change the Headers in the response.

My frustration, is that I can change the ETAG header and it is
returned by the browser at the next request but I can't seem to get
the Cache Control or Expire header accepted by the browser

Does anybody have a clue why? Is this a browser issue and if so does
anybody have a work around? The Etag is very useful because it
reduces the work on the servers, but still requires the client
(browser) to connect to the server. I want to add a Cache-Control
header which would remove the need for the client to connect to the
server at all, until the header had expired.

A snippet of code is below:-

response=HttpResponse(status=304)
response["Etag"] = "test Etag" # This works. It gets picked up and
returned in the next request by Firefox

response["Cache-Control"]="max-age=120" # This does not work.
Firefox keeps returning max-age=0

response["Expires"]= "Mon, 18 Feb 2009 13:36:08 GMT" # This does not
work. Firefox calls the server.

return response
Reply all
Reply to author
Forward
0 new messages