On Fri, Sep 16, 2011 at 2:22 PM, Bryce Cutt <[email protected]> wrote:

> I think Nick meant that popular content is less likely to be evicted from
> the cache, not that it is only cached if it is popular.
>

Oh, thanks, Bryce.


On Sun, Sep 18, 2011 at 1:49 AM, Robert Kluin <[email protected]>wrote:

> I'd also like to see a rough idea of what to expect from the edge-cache
> layer included in the documentation.
>

I opened http://code.google.com/p/googleappengine/issues/detail?id=5915 in
case anyone wants to star. Looking forward to the attention of the GAE team.


In the meantime, it would be cool if there were a reference app
demonstrating various usage of the edge cache. I'm picturing something like
this (in flask <http://flask.pocoo.org>speak):

@app.after_request
def make_conditional(response):
    """
    Unconditional request handled by Python::

        $ curl -I foo.appspot.com
        HTTP/1.1 200 OK
        Cache-Control: public, max-age=9999
        ETag: "foo"
        ...

    You should see "in Python" logged for this request.

    Subsequent conditional request should be handled by Google's edge
cache::

        $ curl -H'if-none-match: "foo"' -I foo.appspot.com
        HTTP/1.1 304 Not Modified
        ...

    "in Python" won't be logged for this request if handled by the edge
cache.

    """
    app.logger.debug('in Python')
    response.cache_control.public = True
    response.cache_control.max_age = 9999
    # in case Google's edge cache isn't working, serve 304s from Python:
    response.add_etag()
    return response.make_conditional(request)



I'm seeing "in Python" logged for both requests when I try something like
this. If anyone has any working examples, please share them.

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

Reply via email to