We've had a problem for years where open pages don't pin their source in the cache. I think we should change that, but our cache doesn't quite deal with things well enough yet...

Here's how I think it should work:

1) Documents loaded from a channel grab the cache token from the channel
   and hold on to it to pin the entry in the cache.  This could be done
   right now.  Then we can use this for things like view source, save
   as, session history, etc.  Not sure about the session history aspect,
   though; I'm not sure we want to pin 50 pages per tab.  That part
   might need thought.
2) We fix things so that our cache can deal with hash collisions.  This
   is needed so that we don't have to evict one entry to put in another
   one with the same key.
3) We sort out the behavior for cases when the key not only collides in
   terms of the hashing function but is actually the same (e.g. the URI
   for a GET request) but needs a new cache entry (say the old one
   expired).  We really want to be able to serve up both the old and
   new entry, depending on cache token, but hand back only the new one
   for "normal" cache access.  This implies having a list of entries
   for every key or something.
4) We need to not count pinned entries towards the cache size limit,
   I think.  This means that the cache needs to know which entries
   are pinned.  Perhaps this already works.  We're trying this approach
   right now for imagelib, so we should be able to get some data on how
   well it works, hopefully.

Thoughts?

-Boris
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to