Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Details on Google App Engine's caching proxy?

Google App Engine must have some sort of reverse caching proxy because when I set the response header Cache-Control public, max-age=300 from one of my servlets, subsequent requests to the app engine show up in the logs like this: /testcaching 204 1ms 0cpu_ms 49kb, whereas non-cached requests show up in the logs as: /testcaching 200 61ms 77cpu_ms 49kb.

Anyways, my question is: Does anyone have any more details about this reverse caching proxy?

like image 832
Kyle Avatar asked Oct 16 '10 04:10

Kyle


2 Answers

The best documentation I've found about App Engine's caching proxy is a post to the App Engine group. Relevant parts quoted below for posterity. All credit goes to Brandon Wirtz:

"If you want edge caching to work you need to make sure you have done the following things

  1. Set Public. If you don’t set public it won’t be cached ever.
  2. Set a max-age. If you set public but don’t specify max-age it won’t be cached
  3. Use a comma. public, max-age=300 works fine. Public; max-age=300 does not.
  4. Set an age greater than 60. 61 seems to cache. 60 does not. There is probably some volume to will I cache based on expiration, but 61 seconds at the volumes we run 61 seems to cache and 60 doesn’t ever seem to.
  5. Set an age less than 366 days. 364 days seems to work. 365 works most the time. 366 never seems to work. So those “Expire never” kinds of posts people talk about for versioned assets that never expire. Well 10 years is not the right answer.
  6. Expires with a date doesn’t seem to help, and seemingly may prevent caching in some instances. I think this may be clock drift. Or something about how picky the parser is about the format of the date. Things that work in browsers don’t always work correctly in the edgecache… (like the Semi vs the comma)
  7. Set both Pragma and Cache-Control. If Pragma is not set Public then Cache-Control seems to be ignored."
like image 111
mndrix Avatar answered Oct 13 '22 11:10

mndrix


Some of the details it would be nice to have answers for:

http://code.google.com/p/googleappengine/issues/detail?id=2258#c3

like image 41
user103576 Avatar answered Oct 13 '22 12:10

user103576