On 08/25/2011 05:56 AM, Thomas Mortagne wrote: > On Thu, Aug 25, 2011 at 12:00 PM, Caleb James DeLisle > <[email protected]> wrote: >> In order to fix a problem with the cache, I would like to add a pointer type >> to the storage api. >> The problem with the cache is there are multiple names which, when asked of >> the persistent store, >> return the same document. There is no effective way to know what all names >> which will return that >> document. When a document is modified, it is removed from the cache but the >> only version removed is it's >> "real" name. All of the other names for it linger in the cache eating up >> memory and threatening to >> provide someone stale data. >> Instead of caching the document, we could cache a pointer to the document >> and when it became stale, >> the pointer could be set to null and then any other name under which that >> document was cached would look >> up a null pointer and the cache logic could remove it. >> >> I would like to add it to xwiki-platform-store-api module and it will look >> roughly like this: >> >> package org.xwiki.store; >> >> public final class Pointer<T> >> { >> /** The thing which this pointer points to. */ >> public T target; >> } >> >> >> WDYT? > > Why is there several cache keys for the same document ? Can't we make > sure a same document always use the same key ?
When you get a document and put it in the cache, you can put it under it's canonical key which might, for instance, be xwiki:Main.WebHome:en but most of the requests for that document will go to xwiki:Main.WebHome (which returns the same document from the store). If you refuse to cache under any key but the canonical key, you will defeat most of the cache's usefulness. BTW: This is the issue: http://jira.xwiki.org/jira/browse/XWIKI-6170 Caleb > >> >> Caleb >> >> _______________________________________________ >> devs mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/devs >> > > > _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

