This is a class that lets you access data from the cache for a given prefix.
How it works
It looks for data in the following order:
- VariablesLua (util) - this is essentially a page-level cache that last until the end of the page render (speeds up accessing data fetched previously on the same page).
- LuaCache - this is a site-level cache that stores anything loaded into it previously. See Module:Cache for more details on refreshing this cache.
- If no data is in the cache, we default back to using
mw.loadDatato load the data and fetch it normally
At each stage, the cache will we update it nothing was available. So if nothing was in the lua cache, it will be placed into the lua cache for the next time.