Help:Configuration parameter "$smwgCacheUsage"

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


Title $smwgCacheUsage
Description Sets how the caching behaviour or special pages related to Semantic MediaWiki is controlled
Default setting See below
Software Semantic MediaWiki
First version supported
Last version supported still available
Configuration Cache
Keyword cache · object cache · special page · performance

$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"Lists properties and displays their usage, special page "WantedProperties"Lists used properties with no explicit datatype assignment, special page "UnusedProperties"Lists properties with an explicit datatype assignment without having a value assignment (annotation), special page "SemanticStatistics"Lists statistics about semantic data 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"Lists properties and displays their usage and special page "SearchByProperty"Allows to search the wiki by properties or property value combinations. 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 3 January 2014 and compatible with MW 1.19.0 - 1.22.x.. With Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x. 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 and compatible with MW 1.27.0 - 1.30.x. 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 and compatible with MW 1.27.0 - 1.30.x..

Default setting

$smwgCacheUsage = array(
	'special.wantedproperties' => 3600,
	'special.unusedproperties' => 3600,
	'special.properties' => 3600,
	'special.statistics' => 3600,
	'api.browse' => 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"Lists used properties with no explicit datatype assignment
  • 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"Lists properties with an explicit datatype assignment without having a value assignment (annotation)
  • 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"Lists properties and displays their usage
  • 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"Lists statistics about semantic data
  • 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.
Option related to API-module "smwbrowse"Allows to search for properties, categories and concepts
  • api.browse – 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.

Changing the default setting

NoteNote: 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 this configuration setting, add one of the following suggested 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"Lists properties and displays their usage:

$smwgCacheUsage = array(
	'special.wantedproperties' => 3600,
	'special.unusedproperties' => 3600,
	'special.properties' => false,
	'special.statistics' => 3600,
	'api.browse' => 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
);
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"Lists properties and displays their usage:

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

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2699
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2730