[Mediawiki-l] Hook called on cache miss?
Stephan Gambke
s7eph4n at gmail.com
Thu Nov 10 20:49:17 UTC 2011
That's what you get when you are too fixed on one solution, I never even
thought of separating caching the page from caching the definition.
Thanks Brion!
Am 10.11.2011 18:13, schrieb Brion Vibber:
> A more typical caching pattern within MediaWiki would look something like
> this:
>
> * devise an appropriate cache key involving the form's id or title, eg
> wfCacheKey( 'formdata', $page->articleId() );
> * at times when you would fetch the form definition data, first pull that
> key from cache
> ** if cache hit, use that data
> ** if cache miss, fall through to existing article fetch & form definition
> parsing
> *** after generating that data, save it to cache
> * when form pages are saved anew, delete the cache entry so it can be
> regenerated with fresh data
>
> You can grab caches from wfGetMainCache() and friends (by default the main
> cache is a null-op, whereas wfGetParserCacheStorage() will to go the
> objectcache table if something like memcache isn't being used, so will
> always actually store stuff).
More information about the MediaWiki-l
mailing list