Page MenuHomePhabricator

Complete documentation about different types of caching for extension developers
Closed, ResolvedPublic

Description

Problem

As an extension developer, I often ran into issues where my code would not be executed / updated due to some cache hit in earlier parts of the code. Documentation is spread out all over MediaWiki, and incomplete.

Who would benefit

Extension developers who write code that dynamically changes page content and need to know when and how to invalidate the caches.

Proposed solution

A good starting point is https://www.mediawiki.org/wiki/Manual:Caching. We need to complete the information missing for some cache types. A rough description of which caches are used when in the execution order would be extremely helpful (maybe in relation to some central hooks). Also, some information of how these caches can be invalidated within the code and in general should be added.

Event Timeline

This project is selected for the Developer-Wishlist voting round and will be added to a MediaWiki page very soon. To the subscribers, or proposer of this task: please help modify the task description: add a brief summary (10-12 lines) of the problem that this proposal raises, topics discussed in the comments, and a proposed solution (if there is any yet). Remember to add a header with a title "Description," to your content. Please do so before February 5th, 12:00 pm UTC.

Thanks @Mglaser for bringing this up. https://www.mediawiki.org/wiki/Manual:Caching is actually a fairly recently addition to mediawiki.org in its current form. I wrote it last year following a major refactoring and subsequent simplification of object cache entry points.

For the most part, our cache interfaces have been reduced to only three (local, cluster, and main). The actual number of caching layers as used logically by the application for different purposes is much greater and requires more documentation indeed. The manual page lists a few, but is far from complete.

See also:

Mglaser claimed this task.

Thanks, Krinkle, and sorry for the extremely late answer :) The https://www.mediawiki.org/wiki/Manual:Cache page is perfect and helps a lot.