On Tue, Jul 20, 2010 at 9:07 AM, Peter17 peter017@gmail.com wrote:
Hello to all!
I am currently working on interwiki transclusion [1].
In the proposed approach, we currently retrieve distant templates:
- using wfGetLB('wikiid')->getConnection if the distant wiki has a
wikiid in the interwiki table
That won't work. Wikimedia doesn't use the text table, so you can't just query the text table. When calling things like getRevText() locally, it's actually accessing external storage, not querying the database.
- using the API in the opposite case
In case 1, it seems that retrieving a template from a distant DB is just as expensive as retrieving it from the local DB. So, we don't store the wikitext of the template locally.
In case 2, the retrieved wikitext is cached in the transcache table for an arbitrary time.
Currently the transcache table stores any entries, regardless of where they were transcluded from (farm or remote wiki). This probably doesn't need to be the situation for case 1, like you said.
I have two questions about this system:
- Is it better to use the transcache table or to use memcached for the
API-retrieved remplates?
- Should we cache the DB-retrieved templates with memcached?
Memcached, imho. It's faster than the DB and handles expiries on its own. And for sites without Memcached, they can always use CACHE_DB or CACHE_ACCEL.
An advantage of memcached here is that it is shared by all the WMF wikis, whereas the transcache table is owned by a wiki for itself.
It's also generally faster, handles its own expiries and allows for a bit more flexibility in cache times (some things can be cached longer than others, potentially).
-Chad