$smwgCacheUsage

From Linux Web Expert


Template:Interlanguagelink: en
Configuration parameter details:
Name $smwgCacheUsage
Description Sets how the caching behaviour or special pages related to Semantic MediaWiki is controlled
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Cache
Keyword cache · object cache · special page · performance


__NOBREADCRUMBLINKS__

$smwgCacheUsage is a configuration parameter that is used to control the caching behaviour of special pages displaying statistical information about the the property usage count on the respective special pages: special page "Properties"No description was provided., special page "WantedProperties"No description was provided., special page "UnusedProperties"No description was provided., special page "SemanticStatistics"No description was provided. and special page "Statistics"No description was provided.. Moreover this setting also controls the feature providing search suggestions with autocompletion to improve the selection of properties on special pages that have input fields namely special page "Ask"Provides an interface that assists users with creating and executing semantic queries, special page "Properties"No description was provided. and special page "SearchByProperty"No description was provided.. Thus the setting helps increasing the overall performance of the wiki by avoiding to access the individual tables holding the property information and count the respective rows on each access. It was introduced in Semantic MediaWiki 1.9.0Released on an unknown date unknown versions of MediaWiki. With Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki it was extended by the option to control the caching for API-module "smwbrowse"Allows to search for properties, categories and concepts.1

This configuration parameter requires configuration parameter $smwgCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes be set; otherwise caching will have no effect.
This configuration parameter underwent a major change in Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki with regard to the available options aiming at simplifying the setup.2 See this version of the documentation available for releases prior to Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki.

Default setting

$smwgCacheUsage = array(
	'special.wantedproperties' => 3600,
	'special.unusedproperties' => 3600,
	'special.properties' => 3600,
	'special.statistics' => 3600,
	'api.browse' => 3600,
	'api.browse.pvalue' => 3600,
	'api.task'  => 3600
);

The default means that all statistical information on the special pages mentioned as well as for the API module mentioned above are being cached for one hour.

Available options

Option related to special page "WantedProperties"No description was provided.
  • special.wantedproperties – Sets whether to serve statistical data for wanted properties from cache and the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.
Option related to special page "UnusedProperties"No description was provided.
  • special.unusedproperties – Sets whether to serve statistical data for unused properties from cache and the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.
Option related to special page "Properties"No description was provided.
  • special.properties – Sets whether to serve statistical data for properties from cache and the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.
Option related to special page "SemanticStatistics"No description was provided.
  • special.statistics – Sets whether to serve statistical data for properties from cache and the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.
Options related to API-module "smwbrowse"Allows to search for properties, categories and concepts
  • api.browse – Sets whether to serve statistical data from cache for objects, i.e. properties, categories and concepts, to be searched via the the "browse" module. It also sets the number of seconds before the cache expires. Serves as general cache. Default is "3600" (one hour). Set to "false" to disable caching.
  • api.browse.pvalue – Sets whether to serve statistical data from cache for property values to be searched via the "pvalue" module. It also sets the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.
Options related to API-module "smwtask"Allows to invoke and execute internal Semantic MediaWiki tasks
  • api.task – Sets whether to serve statistical data from cache for the "task" module. It also sets the number of seconds before the cache expires. Default is "3600" (one hour). Set to "false" to disable caching.

Changing the default setting

To change one or more of the settings for this configuration parameter always the whole array has to be added to your "LocalSettings.php" file, even if some option were not changed from their defaults.

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

Disabling the caching for a specific special page

To disable the caching for e.g. special page "Properties"No description was provided.:

$smwgCacheUsage = array(
	'special.wantedproperties' => 3600,
	'special.unusedproperties' => 3600,
	'special.properties' => false,
	'special.statistics' => 3600,
	'api.browse' => 3600,
	'api.browse.pvalue' => 3600,
	'api.task'  => 3600
);
Disable caching for the api module

To disable the caching for e.g. API-module "smwbrowse"Allows to search for properties, categories and concepts:

$smwgCacheUsage = array(
	'special.wantedproperties' => 3600,
	'special.unusedproperties' => 3600,
	'special.properties' => 3600,
	'special.statistics' => 3600,
	'api.browse' => false,
	'api.browse.pvalue' => false,
	'api.task'  => 3600
);
Extending the caching period for specific special pages

To extend the caching period to one day for e.g. all special pages except for special page "Properties"No description was provided.:

$smwgCacheUsage = array(
	'special.wantedproperties' => 86400,
	'special.unusedproperties' => 86400,
	'special.properties' => 3600,
	'special.statistics' => 86400,
	'api.browse' => 3600,
	'api.browse.pvalue' => 3600,
	'api.task'  => 3600
);
#scite could not render a citation text for reference "gh:smw:2730" because type "pullrequest" was not assigned to a template.

References

  1. ^ gh:smw:2699 
  2. ^ gh:smw:2730