On Mon, 2012-03-05 at 19:01 -0800, Jonas Sicking wrote:
> We should definitely be able to come up with an API which provides
> some cache control for pages. My first question is, what are the use
> cases? I.e. what is it that people want to do?
>
I heard that cache detection might be used to choose between low and
high bandwidth page elements.. especially if the high res ones could be
asynchronously brought into cache for future use.
> Is it as simple as facebook knowing that you'll likely need resource
> at url X in a few seconds, and so want to make us start fetching it
> now?
>
that is an additional part of it yes - but also the straight up query.
> Or do they need to pin an resource in the cache because the user
> experience would be really bad if they had to hit the network (I.e.
> the resource is an image that is part of an animation or a mouse-over
> effect, or is used in a game).
I asked this - the answer was that pinning and {cache query, async load}
are separate. They seemed to feel that localstorage (etc..) were
acceptable for pinning, and while they wanted the http cache to do the
rest for them but they were willing to abuse localstorage only if they
couldn't get the results they wanted any other way.
>
> I'd like to hear more about why people want to query if an item exists
> in the cache. Would it be ok that even if they get a "yes" answer, by
> the time they use the resource it might have gotten evicted. Last time
> I checked, people didn't quite realize this. We could of course
> provide a way to hand back a cache token which would keep the item
> pinned as long as it was kept alive.
I double checked this - and at least the 2 people that responded to me
understood there was a time of check time of use problem and they were
ok with that.
>
> The article Taras is linking to is actually asking for something very
> simple: Being able to update the expiration of a already-cached
> resource. But looking at the comments it doesn't seem like everyone
> thinks it's a good idea. And further down in the comments he
> acknowledge that he might not understand the HTTP cache as well as he
> gives the impression to do.
>
cache invalidation is pretty interesting especially in a "logout" kind
of scenario.
>
> In general, one problem that I feel that we often run into is that
> people simply don't understand the features that we already have for
> cache control. In particular people seem to have a terrible time
> setting their cache headers correctly. This is of course not meant to
> blow off the problem. If the features are too complex to use then we
> need better features.
>
well, the meeting I was talking about was the velocity group you hooked
me up with. The attendees there were certainly aware of how caching is
specified to work (which I agree does not make them typical) and they
still had the distinct impression that hit rates were much poorer than
they would expect - though no hard data on that front. I'll have a
different summary post to d.t.n later on the generalized feedback from
that group.