Status: | effective |
Progress: | 75% |
Version: | 2.5.0+ |
Table of Contents | |
---|---|
Cache (or caching) is a storage mechanism by which previously computed values are stored separately from the original request so that using the already computed results, future requests are served faster.
The general suggestion, where feasible, is to use redis
1234 as cache backend to ensure that large blob objects can be stored and retrieved without impacting the general performance.
Technical aspects[edit]
- HtmlCache
- WebCache (eg. Squid)
- ParserCache
- QueryCache
Configuration settings[edit]
Caching, whether temporary or persistent, is an important part of MediaWiki's storage strategy. It is also an important infrastructural component in Semantic MediaWiki that improves the editing and viewing experience and helps to reduce the number of computational tasks that are required by the extension.
One dedicated subtype of cache in MediaWiki is parser cache. It targets parsing, the process of turning wikitext into a HTML representation, because parsing is one of the more expensive and memory-intensive tasks of the software, all the more so because the Parser allows extensions to add or modify data before the output is produced. Parser cache is designed to cache the rendered output of a wiki page and the main parser cache stores output of the latest revision of a page.
MediaWiki[edit]
$wgParserCacheType
(MediaWiki.org) − Sets how to use parser cache to cache parsed pages in order to speed up the output of the page (as viewed by another user with the same options).
Semantic MediaWiki[edit]
-
$smwgMainCacheType
Sets which object cache Semantic MediaWiki should use to track temporary changes - see also$smwgCacheType
Sets which object cache Semantic MediaWiki should use to track temporary changes -
$smwgQueryResultCacheType
Sets whether the query result cache may be used in conjunction with$smwgQueryResultCacheLifetime
Sets the cache lifetime of embedded queries and their results fetched from the query engine- Cache eviction is triggered by:
- end of lifetime (handled by cache provider)
- query dependency changed (handled by
$smwgEnabledQueryDependencyLinksStore
Sets whether tracking and storing of dependencies of embedded queries may be used if enabled) or - manual eviction by user (
$smwgQueryResultCacheRefreshOnPurge
Sets whether it is possible to manually refresh the query cache by doing a "purge" action)
- Cache eviction is triggered by:
Related
-
$smwgFactboxFeatures
Sets the behaviour of features related to the factbox with optionsSMW_FACTBOX_CACHE
andSMW_FACTBOX_PURGE_REFRESH
See also[edit]
- Help page on concept caching
- PHP Caching solutions and performance
- Page loading time
- Semantic MediaWiki: GitHub issue 4245– Why caching matters?
Note[edit]
Please be aware that this page is being used as reference in MediaWiki:Smw-sp-properties-cache-info.
References
- ^ Why Redis beats Memcached for caching "... Memcached and Redis serve as in-memory, key-value data stores ... Redis gives you much greater flexibility regarding the objects you can cache. While Memcached limits key names to 250 bytes and works with plain strings only, Redis allows key names and values to be as large as 512MB ..."
- ^ How fast is Redis?
- ^ Clarifications about Redis and Memcached
- ^ The issue with APCu is that it will store its cache in the PHP shared memory and means that different PHP processes share the available memory. See also Additional notes for Redis vs. APCu on Memory Caching