$smwgQueryResultCacheLifetime

From semantic-mediawiki.org


Configuration parameter details:
Name $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[edit]

$smwgQueryResultCacheLifetime = 60 * 60 * 24 * 7;

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

Changing the default setting[edit]

To modify the setting to this configuration parameter, 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
$smwgQueryResultCacheLifetime = 60 * 60 * 24 * 30;

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

See also[edit]

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 ..."