While we have not tried this with flexible runtimes, on standard GAE we are 
using cache-control, and pragma headers.  we do not use the vary header.  
while not documented the GAE support folks confirmed that google's caching 
proxy will not cache responses with certain values for the vary header 
(like custom headers and language headers), so you might try removing that 
from both systems.

also last i checked the cache was not guaranteed, and it's possible if your 
second app has low traffic that it's deemed not worth caching?  this area 
is a black box to me.

cfh

On Wednesday, August 3, 2016 at 4:34:11 PM UTC-7, Nick (Cloud Platform 
Support) wrote:
>
> Hey Matt,
>
> This is very interesting, and although I'd almost say it qualifies for a 
> post to the Public Issue Tracker, we can also discuss it here, since it's 
> somewhat broad, and it would be inconvenient to migrate all this info.
>
> Are you making your requests from behind any kind of proxy? This is 
> something which comes to mind. 
>
> I'll see if we can see anything from our end in the meantime.
>
> Cheers!
>
> Nick
> Cloud Platform Community Support
>
> On Monday, August 1, 2016 at 11:22:16 AM UTC-4, Matt Mohebbi wrote:
>>
>> I have a nodejs application I deploy to Appengine Flexible Environment 
>> via a docker custom runtime. When I deploy to one project (iodine-test), I 
>> get the great caching features of the Google Frontend:
>>
>> air:/tmp/plum/deploy-20160727-124350% curl -w 
>> "@/Users/matt/bin/curl-time-format.txt" -o /dev/null -s "
>> http://iodine-test.appspot.com/drug/zoloft"; -v
>>
>> *   Trying 216.58.194.209...
>>
>> * Connected to iodine-test.appspot.com (216.58.194.209) port 80 (#0)
>>
>> > GET /drug/zoloft HTTP/1.1
>>
>> > Host: iodine-test.appspot.com
>>
>> > User-Agent: curl/7.43.0
>>
>> > Accept: */*
>>
>> > 
>>
>> < HTTP/1.1 200 OK
>>
>> < Content-Type: text/html; charset=utf-8
>>
>> < ETag: W/"30a48-XHteNhi+a5i5072zCcVDyg"
>>
>> < Vary: Accept-Encoding
>>
>> < Via: irbk129:14580
>>
>> < X-Cloud-Trace-Context: 02917deaade7c823eed970361cd13ded;o=1
>>
>> < Date: Mon, 01 Aug 2016 15:15:49 GMT
>>
>> < Server: Google Frontend
>>
>> < Content-Length: 199240
>>
>> < Cache-Control: public, max-age=604800
>>
>> < Age: 7
>>
>> < 
>>
>> { [6754 bytes data]
>>
>> * Connection #0 to host iodine-test.appspot.com left intact
>>
>>     time_namelookup:  0.004
>>
>>        time_connect:  0.011
>>
>>     time_appconnect:  0.000
>>
>>    time_pretransfer:  0.011
>>
>>       time_redirect:  0.000
>>
>>  time_starttransfer:  0.023
>>
>>                     ----------
>>
>>          time_total:  0.048
>>
>>
>> However, when I deploy this same application to a different project 
>> (iodine-web-prod), caching doesn't occur on *any* of the requests, 
>> regardless of how often I request the same resource. 
>>
>>
>> air:/tmp/plum/deploy-20160727-124350% curl -w 
>> "@/Users/matt/bin/curl-time-format.txt" -o /dev/null -s "
>> http://iodine-web-prod.appspot.com/drug/zoloft"; -v
>>
>> *   Trying 216.58.195.241...
>>
>> * Connected to iodine-web-prod.appspot.com (216.58.195.241) port 80 (#0)
>>
>> > GET /drug/zoloft HTTP/1.1
>>
>> > Host: iodine-web-prod.appspot.com
>>
>> > User-Agent: curl/7.43.0
>>
>> > Accept: */*
>>
>> > 
>>
>> < HTTP/1.1 200 OK
>>
>> < Content-Type: text/html; charset=utf-8
>>
>> < Cache-Control: public, max-age=604800
>>
>> < ETag: W/"30a48-XHteNhi+a5i5072zCcVDyg"
>>
>> < Vary: Accept-Encoding
>>
>> < Via: iwer4:25789
>>
>> < X-Cloud-Trace-Context: fd82e108c58b92e3114028fdfcd22105;o=1
>>
>> < Date: Mon, 01 Aug 2016 15:16:46 GMT
>>
>> < Server: Google Frontend
>>
>> < Content-Length: 199240
>>
>> < 
>>
>> { [15256 bytes data]
>>
>> * Connection #0 to host iodine-web-prod.appspot.com left intact
>>
>>     time_namelookup:  0.005
>>
>>        time_connect:  0.010
>>
>>     time_appconnect:  0.000
>>
>>    time_pretransfer:  0.010
>>
>>       time_redirect:  0.000
>>
>>  time_starttransfer:  1.503
>>
>>                     ----------
>>
>>          time_total:  1.536
>>
>>
>> I've combed through the bits and pieces of unofficial documentation:
>>
>>
>> https://code.google.com/p/googleappengine/issues/detail?id=2258
>>
>>
>> https://web.archive.org/web/20110826081218/http://www.kyle-jensen.com/proxy-caching-on-google-appengine
>>
>>
>> https://groups.google.com/forum/#!topic/google-appengine/6xAV2Q5x8AU/discussion
>>
>>
>> And also reviewed the documentation for Google Cloud CDN assuming that 
>> the policies outlined there are the same as those applied to Appengine. 
>>
>>
>> https://cloud.google.com/cdn/docs/caching
>>
>>
>> However, nothing explains why I would be getting this inconsistent 
>> behavior between projects. Any ideas?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/2e3caab9-d78f-477a-aec2-c35f2da17fbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to