Caching is a "best effort" attempt to reduce load and should never be
thought of as a foolproof mechanism to prevent requests from hitting your
server. In the case you are describing, URL parameters still work since they
prevent the proxies and browsers from storing things they shouldn't store.
Most proxies and browsers key off URL, including any request parameters. I
have personally never seen browsers or proxies that will not cache a URL
with parameters, but I believe they may exist. It's not the worst thing in
the world if your assets are not cached - in some cases it is 100x worse to
serve a stale asset, especially if your app is JavaScript heavy.
In any case, URL rewriting is a pretty good technique as well, I just don't
think it's fair to call appending a query parameter problematic, as I feel
it is is an overall easier approach than URL rewriting. In either case, they
both encourage the best practice of creating methods in templating language
to rewrite image, media and JS tags. For instance, in JSPs, you could have
something like the following to output tags:
<%= AssetTag.imageUrl("someImage.jpg") %>
(I should write a blog post or something about this subject.)
On Mon, Jun 21, 2010 at 12:41 AM, TL <[email protected]> wrote:
> On Jun 15, 4:36 pm, "Ikai L (Google)" <[email protected]> wrote:
> >
> > What are the other problems?
>
> The major problem is that browsers and proxy servers may not cache any
> URL that has request parameter, regardless of caching headers returned
> by the response (such as max-age). This is up to the proxies and user
> agents which have varying policies. On the other hand, using simple
> resource name with no parameters, does not exhibit such behaviors.
>
> --
> 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.