On Wed, 2009-09-23 at 02:34 +0100, John-Mark Bell wrote:

> Once the cache has the post-redirect URL[1], 

The downside of forward-declaring footnotes is that you then forget to
write their contents.

1. I have deliberately hand-waved the issue of finding the post-redirect
URL, as it's entirely the preserve of the low-level cache (which knows
nothing of contents or internment contexts). 

The naïve way is for the low-level cache to store the post-redirect URL
with the cached source data. Then, when a request for a low-level cache
object for a given URL is made, it looks for that URL and, if none is
found, triggers a fetch and then searches for relevant cache objects
once we know the redirect target URL and before following the redirect.

It should be possible to optimise this by having the low-level cache
cache redirect chains, so that it does not need to perform the fetching
unless absolutely necessary. Initially, however, I'm inclined to just
implement the trivial approach, sans caching, and introduce redirect
chain caching if it becomes apparent that there's a performance gain to
be had. I'm somewhat wary of the potential for stale entries in redirect
chain caches -- unlike for contents, there's no cache expiry algorithm
that's guaranteed not to break the web.


J.


Reply via email to