mermer
unread,Feb 16, 2009, 9:41:29 AM2/16/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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