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 1.9.0
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 "Properties", "WantedProperties", "UnusedProperties", "SemanticStatistics" and "Statistics". 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", "Properties" and "SearchByProperty". 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.0.

Important noteImportant Note: Requires configuration parameter $smwgCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes.]] be set; otherwise caching will have no effect.

Default setting

$smwgCacheUsage = array(
    'smwgWantedPropertiesCache' => true,
    'smwgWantedPropertiesCacheExpiry' => 3600,
    'smwgUnusedPropertiesCache' => true,
    'smwgUnusedPropertiesCacheExpiry' => 3600,
    'smwgPropertiesCache' => true,
    'smwgPropertiesCacheExpiry' => 3600,
    'smwgStatisticsCache' => true,
    'smwgStatisticsCacheExpiry' => 3600
);

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

Available options

Options related to special page "WantedProperties"
  • smwgWantedPropertiesCache - Sets whether to serve statistical data for wanted properties from cache or not. Default is "true".
  • smwgWantedPropertiesCacheExpiry - Sets the number of seconds before the cache expires. Default is "3600" (one hour).
Options related to special page "UnusedProperties"
  • smwgUnusedPropertiesCache - Sets whether to serve statistical data for unused properties from cache or not. Default is "true".
  • smwgUnusedPropertiesCacheExpiry - Sets the number of seconds before the cache expires. Default is "3600" (one hour).
Options related to special page "Properties"
  • smwgPropertiesCache - Sets whether to serve statistical data for properties from cache or not. Default is "true".
  • smwgPropertiesCacheExpiry - Sets the number of seconds before the cache expires. Default is "3600" (one hour).
Options related to special page "SemanticStatistics"
  • smwgStatisticsCache - Sets whether to serve statistical data for properties from cache or not. Default is "true".
  • smwgStatisticsCacheExpiry - Sets the number of seconds before the cache expires. Default is "3600" (one hour).

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

$smwgCacheUsage = array(
    'smwgWantedPropertiesCache' => true,
    'smwgWantedPropertiesCacheExpiry' => 3600,
    'smwgUnusedPropertiesCache' => true,
    'smwgUnusedPropertiesCacheExpiry' => 3600,
    'smwgPropertiesCache' => false,
    'smwgPropertiesCacheExpiry' => 3600,
    'smwgStatisticsCache' => true,
    'smwgStatisticsCacheExpiry' => 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":

$smwgCacheUsage = array(
    'smwgWantedPropertiesCache' => true,
    'smwgWantedPropertiesCacheExpiry' => 86400,
    'smwgUnusedPropertiesCache' => true,
    'smwgUnusedPropertiesCacheExpiry' => 86400,
    'smwgPropertiesCache' => true,
    'smwgPropertiesCacheExpiry' => 3600,
    'smwgStatisticsCache' => true,
    'smwgStatisticsCacheExpiry' => 86400
);