Re: [google-appengine] Preventing GAE edge-cache caching

194 views
Skip to first unread message

Takashi Matsuo

unread,
Aug 8, 2012, 4:00:11 AM8/8/12
to google-a...@googlegroups.com
Hi prem,

I would suggest setting appropriate cache timeout rather than trying
to control every edge-cache type things, because even if you use your
own edge cache system, it is possible there are other edge-cache
systems between your end-users and your edge-cache.

On Tue, Aug 7, 2012 at 5:56 PM, prem <playo...@gmail.com> wrote:
>
> I have been learning GAE(python) for my next project, a custom multi-tenant
> CMS. Everything look great, except for 1 major blocker.
>
> Most of content pages in the CMS usually won't change for months, so edge
> caching is important. When end users edit the pages, I would need to
> purge/invalidate the edge-cache.
>
> My understanding is, currently GAE, does not allow the edge-cache to be
> purged/invalidated.
>
> The next option would be to use an external CDN ( MaxCDN/Cloudfare/etc) or
> maybe Varnish.
>
> My concern is, any cache headers present in pages will be processed by GAE
> edge-cache as well as external cache.
>
> Is it possible to prevent GAE from edge-caching even if the cache headers
> are set in response pages?
>
> -prem
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/HYqCDuoDtE4J.
> 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.



--
Takashi Matsuo | Developer Advocate | tma...@google.com

Emanuele Ziglioli

unread,
Aug 8, 2012, 7:19:19 AM8/8/12
to google-a...@googlegroups.com
I use query strings, I append the app version number to each static resource so that caching get invalidated automatically every time I deploy a new version. 

Barry Hunter

unread,
Aug 8, 2012, 7:31:53 AM8/8/12
to google-a...@googlegroups.com
On Wed, Aug 8, 2012 at 9:00 AM, Takashi Matsuo <tma...@google.com> wrote:
> Hi prem,
>
> I would suggest setting appropriate cache timeout rather than trying
> to control every edge-cache type things,

+1 to that.


Can be useful to allow caching of html pages - help deal with traffic
spikes, but set a shortish caching timeout (minutes, or at most
hours), then use conditional-gets - either Last-Modified or Etag's, to
allow the cache to continue to be used, but can be 'refreshed' as and
when its later required.

http://ruturajv.wordpress.com/2005/12/27/conditional-get-request/


(in the ultimate case, the user browser itself is a 'cache' - and
there is no real way to "purge" that.



Static assets (js/css etc) - is very easy to change the URL of the
asset when it changes (the query string is one way of doing that). So
for static assets setting a far future expire, and letting any cache
tahts willing to store it do so, is almost certainly the best way.
'purging' is just changing the url. That can't be done for the html
page itself as "cool urls never change" so, conditional gets (with
some short term caching) is best.

prem

unread,
Aug 9, 2012, 10:19:57 AM8/9/12
to google-a...@googlegroups.com
Takashi, barryhunter, Emanuele ... Am glad I posted here, thanks for the suggestions.

I will have to read up more on cache-control headers to figure out how to make the browsers cache the document but still check for freshness with origin before expiry. 

James Broberg

unread,
Aug 12, 2012, 11:18:12 PM8/12/12
to google-a...@googlegroups.com
Given the voodoo required to actually *enable* the GAE edge cache I would have thought it would be pretty easily to avoid it.

On 10 August 2012 00:19, prem <playo...@gmail.com> wrote:
Takashi, barryhunter, Emanuele ... Am glad I posted here, thanks for the suggestions.

I will have to read up more on cache-control headers to figure out how to make the browsers cache the document but still check for freshness with origin before expiry. 

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/HIhCteRHa7IJ.
Reply all
Reply to author
Forward
0 new messages