The tradeoff with request parameters is that you need to output your image and asset tags in your HTML templates to append a parameter and be version aware. The benefit, however, is that it is an almost 100% foolproof way to bust caches. You don't only have the Google edge cache to worry about - you've always got to worry about ISP proxies, browser caches + other caching schemes that users introduce between their computers and your application. I highly recommend doing this, as you will spend countless hours debugging user issues (I have) that are cache related that could be easily solved by appending a URL parameter. This is especially true if you use any kind of JavaScript code that changes.
What are the other problems? On Tue, Jun 15, 2010 at 1:13 PM, TL <[email protected]> wrote: > That is really the only solid way to do it. Using request parameter > has too many problems to list. > > I did this in a Java app and it does require you to write some code, > since as you mention Java does not have a built in rewrite capability. > > I may add google code project with a Java implementation for app > engine (using the app engine version as a directory). Will keep you > posted. > > E > > On Jun 3, 12:35 pm, Donovan <[email protected]> wrote: > > Another technique for cache busting is URL rewriting within the path > > to the resources, which has some benefits over the query string usage > > in certain cases. > > > > The Python AE runtime supports URL mapping for static resources which > > can make this even less painful and allows long expire times - so for > > example you could generate all static URLs like this: > > > > /static/[app version from environment]/css/foo.css and have it map > > to the static/your/foo.css withint your appengine upload This has an > > advantage in the case of css because then all your resources > > referenced from the CSS (as long as they're using relative URLs under > > the same static directory) are also affected by the path versionion. > > So a > > > > background-image: url(../images/bar.jpeg) ; > > > > declaration in the foo.css above would cause the browser to request > > the resource with the injected app version /static/[app version]/ > > images/bar.jpeg. This would not happen with the query string cache > > busting technique unless you willing to parse your css dynamically > > (and then you're not using the static file appengine servers). > > > > Using this technique you can feel free to set your static file caching > > headers to large values (months to a year) to get a better client > > experience without sacrificing the ability to update your app at will > > (your app version id will change everytime you upload, which creates a > > new URL and new set of cacheable objects to the browser) > > > > Unfortunately, the Java AE runtime does not have a similar support for > > static file URL rewriting - I've done a feature request here (PLEASE > > STAR! :) )http://code.google.com/p/googleappengine/issues/detail?id=2070 > > > > So, to get the same behavior and peformance benefit of hitting the AE > > static file servers, you'd have to physically create a versioned > > directory during the build process before uploading to appengine . You > > could do the same thing for the python as well, but the URL mapping > > feature is so easy to use I've never wanted to do so. > > > > - Donovan > > -- > 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]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine -- 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.
