setting cache-control headers in response; ultimately being ignored
setting cache-control headers in response; ultimately being ignored
- Subject: setting cache-control headers in response; ultimately being ignored
- From: William Hatch <email@hidden>
- Date: Sat, 08 Nov 2008 14:01:14 -0500
- Resent-date: Sun, 09 Nov 2008 09:19:25 -0500
- Resent-from: William Hatch <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Apple WO-Dev <email@hidden>
My goal is to have a da which responds to a request from a content
delivery network where the response headers control how long the cdn
cache's a resource associated with a given url. Generating the
response is fine, but I'm having trouble getting the cache-control
header set properly, according to my log and the wonder log
statements. I'm doing the following where r is my WOResponse object
and maxAge is a string equal to 1d:
r.removeHeadersForKey("cache-control");
r.removeHeadersForKey("pragma");
r.setHeader(("max-age=" +maxAge), "cache-control");
when I explicitly log out the response right after these calls, it
looks good:
headers={cache-control=[max-age=1d], content-length=[308], content-
type=[application/text/html; charset=utf-8], keep-alive=[Connection]}
content-length=308 cookies=null userInfo={}
storePageInBacktrackCache=true >) status=200>
however, ERXApplication.RequestHandling logging indicates that they're
getting reset and ignoring what I had previously set; max-age is zero
and all the other options seem to indicate "don't cache this..."
headers={cache-control=[private, no-cache, no-store, must-revalidate,
max-age=0], content-length=[308], content-type=[application/text/html;
charset=utf-8], date=[Sat, 08-Nov-2008 18:45:31 GMT], expires=[Sat, 08-
Nov-2008 18:45:31 GMT], keep-alive=[Connection], pragma=[no-cache],
set-cookie=[], x-webobjects-loadaverage=[2]} content-length=308
cookies=() userInfo={} storePageInBacktrackCache=true >) status=200>
Sorry if this is basic; I've never screwed around with these specific
headers before other than wacking them to get pdf download to work. Am
I doing something wrong to set the cache-control, or something else,
or what? Thanks.
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden