I've got a custom Node.js server application deployed on Google Application 
Engine (flex environment) that sets the 'ETag' HTTP 1.1 response header for 
specific resource requests using a custom algorithm. This works well and 
provides me with very granular control of resource caching. However, in 
cases where my response is transparently transpiled (e.g. gzip compressed) 
it appears that Google App Engine is stripping off my ETag header and 
throwing it away.

For example, I have a 1 MB bundle of JavaScript that _should_ be downloaded 
_once_ on first run of a newly-deployed version of the application. The 
actual server response sets the ETag HTTP response header with a unique 
digest hash of the file's contents and Content-Type set to "utf8" and 
Content-Encoding set to "application/json". Given Content-Type and 
Content-Encoding I believe GAE concludes that the response can and should 
be gzip'd (my user agent sends HTTP request header Accept-Encoding gzip, 
deflate, br). And, upon receipt of the gzip'd JavaScript, the user agent 
decompresses and of course I'm dealing with the original JavaScript string 
in the browser. So this works. BUT... the user agent never ever receives 
the ETag header. And, so never sends an If-None-Match request header. So 
the file isn't cached as expected and must be downloaded again and again 
and again.

I can't think of any good reason why ETag (or any other cache-related 
response headers) should be altered at all GAE in this case where the 
transpilation is intended to be wholly encapsulated. Do you guys agree this 
is a bug?

Thanks, Chris

-- 
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/92065bfb-2e6e-49d0-a184-0f4424731496%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appe... Christopher Russell
    • [google... 'Tiago (Google Cloud Platform Support)' via Google App Engine

Reply via email to