• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting cache-control headers in response; ultimately being ignored
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting cache-control headers in response; ultimately being ignored


  • Subject: Re: setting cache-control headers in response; ultimately being ignored
  • From: William Hatch <email@hidden>
  • Date: Sun, 09 Nov 2008 16:07:18 -0500

Thanks Ramsey, that did it. I was thinking that the default was the other way around; false by default in other words. Thanks.

Bill



On Nov 9, 2008, at 11:14 AM, Ramsey Gurley wrote:

Hi William,

I think this comes from the backtrack caching.

http://developer.apple.com/documentation/WebObjects/Web_Applications/Articles/8_Backtracking.html#/ /apple_ref/doc/uid/TP40003273

Ramsey

On Nov 8, 2008, at 2:01 PM, William Hatch wrote:


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


_______________________________________________ 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
References: 
 >setting cache-control headers in response; ultimately being ignored (From: William Hatch <email@hidden>)
 >Re: setting cache-control headers in response; ultimately being ignored (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: Confusing lock error solved, but now a restoreSessionWithID lock issue
  • Next by Date: Re: Update & Delete of an Enterprise Object causes EOEditingContext.saveChanges() to Exception
  • Previous by thread: Re: setting cache-control headers in response; ultimately being ignored
  • Next by thread: Bourges
  • Index(es):
    • Date
    • Thread