Help:Configuration parameter "$smwgQueryResultNonEmbeddedCacheLifetime"
|Description||Sets the cache lifetime of non-embedded queries and their results fetched from the query engine|
60 * 10
|First version supported||2.5.0|
|Last version supported||still available|
|Keyword||Caching · Performance · Query performance · browsing interface|
$smwgQueryResultNonEmbeddedCacheLifetime is a configuration parameter that sets the cache lifetime of non-embedded queries and their results, e.g. browsing interfaces such as special page "Ask", etc. or the API fetched from the query engine. It was introduced in Semantic MediaWiki 22.214.171.124
$GLOBALS['smwgQueryResultNonEmbeddedCacheLifetime'] = 60 * 10;
This means that by default lifetime of the query result cache is ten minutes.
Changing the default setting
To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the
- Disable the caching for non-embedded queries
$smwgQueryResultCacheLifetime = 0;
$smwgQueryResultCacheLifetime = false;
- Extend the cache lifetime to an hour
$smwgQueryResultCacheLifetime = 60 * 60;
- This setting can also be used to minimize a possible Denial-of-service attacks by preventing an advisory to make unlimited query requests from either special page "Ask" or the API that may lock the database due to complex query answering and instead being rerouted to the cache once a result has been computed.
- Non-embedded queries cannot not be tracked using embedded query updates since the subject is being missing that would identify the entity. Therefore an auto-purge mechanism as in case of an embedded entity is not possible hence the lifetime should be carefully selected to provide the necessary means for a user and the application.