Add really awesome Magic Output Caching #14

ttencate opened this Issue Jan 14, 2012 · 0 comments

1 participant


Turns out, we already have most of the pieces for this, but we need the Redis-based filesystem first.

Rough outline of the plan:

  • A Site, instead of handing its own Source to a Handler, hands it a special Source wrapper.
  • This wrapper tracks all accesses and stores them in Redis. The key is "i:/path/to/file/or/dir" (i for invalidate), the value is the set of URLs whose Handlers accessed this particular file/directory.
  • When the Handler is done, its output is also stuffed into Redis, keyed as "u:/request/path" (u for URL). This might mean that we have to invoke the Handler from Site, not from WebServer, but that might make more sense anyway.
  • When any change is detected on the filesystem, not only are the new file's contents written into Redis, but we also look up the set "i:/path/to/file/or/dir", iterate through the set, and delete each dependent "u:/request/path" URL from the cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment