| Status: | effective |
| Progress: | 75% |
| Version: | 2.5.0+ |
| Table of Contents | |
|---|---|
Cache (or caching) is specified as an storage mechanism were earlier computed values are stored separately from the original request and hereby enable future requests to be served faster using the already computed results.
The general suggestions (where feasible) is to use redis1234 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 (either temporary or persistent) is an important part of MediaWiki's storage strategy and also became an infrastructural component in recent Semantic MediaWiki releases to ensure that editing and viewing experience is improved. It further helps to reduce the amount of computational tasks performed required by Semantic MediaWiki.
An expensive (and memory intensive) task is MediaWiki's Parser::parse with responsibility to turn wikitext into a HTML representation. It also includes processing (or signalling) extension to add or modify data before the output is produced.
MediaWiki[edit]
$wgParserCacheType(MediaWiki.org) − Sets how to keep parsed pages in a cache to speed up output of the same page viewed by another user with the same options
Semantic MediaWiki[edit]
-
$smwgMainCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes (see also$smwgCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes) -
$smwgQueryResultCacheTypeSets whether the query result cache may be used in conjunction with$smwgQueryResultCacheLifetimeSets 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
$smwgEnabledQueryDependencyLinksStoreSets whether tracking and storing of dependencies of embedded queries may be used if enabled) or - manual by user (
$smwgQueryResultCacheRefreshOnPurgeSets whether it is possible to manually refresh the query cache by doing a "purge" action)
- Cache eviction is triggered by:
Related
-
$smwgFactboxFeaturesSets the behaviour of features related to the factbox with optionsSMW_FACTBOX_CACHEandSMW_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