Problems (cache-related?) since enabling billing

251 views
Skip to first unread message

Mike

unread,
Oct 6, 2010, 10:46:01 AM10/6/10
to Google App Engine
I have an app that sits behind a reverse proxy serving requests for
multiple domains using the X-Forwarded-For header. This has been
working very well for many months. Yesterday, after enabling billing
for the app, I started seeing dynamic requests that were getting
served the wrong content (content for the wrong domain).

In troubleshooting the issue, I noticed that many of the problem
requests are served in only a couple of milliseconds, and the logs
don't contain the normal logging messages that my code should produce,
and don't show up in appstats. I'm assuming this means that the
caching I've read about but never seen to work is now serving requests
(since the Cache-Control header is set), and is not keeping cached
pages separate based on the X-Forwarded-For header, but just the path.

Is there any way to confirm whether this is what is happening? If so,
is there a way to disable this functionality (going back to the way it
worked before we enabled billing), without removing the Cache-Control
header and losing it's benefits?

-Mike

-=-

Ikai Lan (Google)

unread,
Oct 7, 2010, 1:56:39 PM10/7/10
to google-a...@googlegroups.com
Yes, enabling billing enables edge caching for requests that use the cache-control header. This is a "best effort" caching and we do not guarantee you will get it.

Can you describe what the expected behavior should be? What are you trying to do.

--
Ikai Lan 
Developer Programs Engineer, Google App Engine




--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.


Barry Hunter

unread,
Oct 7, 2010, 3:33:18 PM10/7/10
to google-a...@googlegroups.com
Have you tried using the Vary: header?

In theory a caching proxy should use it.

Mike

unread,
Oct 7, 2010, 3:38:11 PM10/7/10
to Google App Engine
Ikai,

Thanks for your response. It definitely helps to have some
confirmation that our observations about the edge cache and billing
were correct.

Technically, the expected behavior was that the app would behave the
same before and after enabling billing, since I don't believe the
caching differences between free and billed is documented anywhere.

After investigating the problems we were experiencing (pages initially
served for one domain in X-Forwarded-Host resulting in cache hits for
subsequent requests for the same path specifying a different X-
Forwarded-Host), I concluded that this was probably expected behavior.
We were able to solve this problem by adding "Vary: X-Forwarded-Host"
to our response headers. Now things are working normally for our app
again.

-Mike

-=-

On Oct 7, 10:56 am, "Ikai Lan (Google)" <ikai.l+gro...@google.com>
wrote:
> > google-appengi...@googlegroups.com<google-appengine%2Bunsubscrib e...@googlegroups.com>
> > .

Mike

unread,
Oct 18, 2010, 4:33:39 PM10/18/10
to Google App Engine
After continued observation, we have found that we are still getting
dynamic resources served from cache without regard to our Vary: X-
Forwarded-Host response header. Also, cached resources do not seem to
pass the Vary header (or other headers) on. This seems like Google's
edge cache is broken with regard to how an HTTP proxy server is
supposed to behave. Is there any way to disable it for a billing-
enabled app without losing the benefits of the Cache-Control header
for other downstream proxies and user-agents?

-=-

On Oct 7, 12:38 pm, Mike <mar...@bluemoonventures.com> wrote:
> Ikai,
>
> Thanks for your response. It definitely helps to have some
> confirmation that our observations about theedge cacheand billing

Stephen

unread,
Oct 19, 2010, 5:31:38 AM10/19/10
to Google App Engine


On Oct 18, 9:33 pm, Mike <mar...@bluemoonventures.com> wrote:
> Is there any way to disable it for a billing-enabled
> app without losing the benefits of the Cache-Control header
> for other downstream proxies and user-agents?


You could try using:

Cache-Control: private

instead of 'public' which should disable Google's caching proxy
server. It will also disable any intermediary shared caches, but at
least you retain client caching. Worthwhile until Google fixes the
Vary header problem.

If you'd like more info on how Google's cache works, consider starring
this issue:

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

Reply all
Reply to author
Forward
0 new messages