Help:Con­figu­ration para­meter "$smwgQueryResultCacheLifetime"

From semantic-mediawiki.org
Jump to: navigation, search
edit with form


Configuration parameter details:
Title $smwgQueryResultCacheLifetime
Description Sets the cache lifetime of embedded queries and their results fetched from the query engine
Default setting
60 * 60 * 24 * 7
Software Semantic MediaWiki
Since version
Until version still available
Configuration Cache · Experimental
Keyword caching · object cache · performance · query performance · query result cache · experimental

$smwgQueryResultCacheLifetime is a configuration parameter that sets the cache lifetime of embedded queries and their results fetched from the query engine. It was introduced in Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x..1

This configuration parameter only takes effect if the query results cache was enabled.

Default setting

$smwgQueryResultCacheLifetime = 60 * 60 * 24 * 7;

This means that by default lifetime of the query result cache is one week.

Changing the default setting

To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Disable forced query result updates
$smwgQueryResultCacheLifetime = 0;

This means that a query result is kept until it is being evicted2 by another trigger. See the help page on query result caching for further information.

Shorten the cache lifetime to a day
$smwgQueryResultCacheLifetime = 60 * 60 * 24;

This means that a query result is kept for a day until it is being evicted2.

Extend the cache lifetime to a month
$smwgQueryResultCacheType = 60 * 60 * 24 * 30;

This means that a query result is kept for a month until it is being evicted2.

See also

Query result caching
Embedded query updates

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1251
  2. a b c  Chapter 4. Cache Eviction being described as " ... the process by which old, relatively unused, or excessively voluminous data can be dropped from the cache ..."