$smwgCacheType

From Linux Web Expert


Template:Interlanguagelink: en
Configuration parameter details:
Name $smwgCacheType
Description Sets which object cache Semantic MediaWiki should use to track temporary changes
Default setting CACHE_ANYTHING
Software Semantic MediaWiki
Since version
Until version still available
Configuration Cache
Keyword cache · object cache · performance


__NOBREADCRUMBLINKS__

$smwgCacheType is a configuration parameter that sets the object cache Semantic MediaWiki should use to track temporary changes. The configuration parameter was introduced in Semantic MediaWiki 1.9.0Released on an unknown date unknown versions of MediaWiki.1

This configuration parameter was superseded by configuration parameter $smwgMainCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki. Thus you are advised to migrate your settings in "LocalSettings.php" to the new configuration parameter after the release of Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki since it will be removed with one of the upcoming releases of Semantic MediaWiki.

Default setting

$smwgCacheType = CACHE_ANYTHING;

This means that by default it uses the cache defined by configuration parameter $wgMainCacheType (MediaWiki.org) for object caching.

Available cache providers

All predefined cache types as provided by configuration parameter $wgMainCacheType (MediaWiki.org) or a custom cache type as set with configuration parameter $wgObjectCaches (MediaWiki.org), e.g. Redis which is the recommended cache provider2 to account for an optimal response time, storage capacity, and independence from the DB master.

  • CACHE_NONE: Does not caching (predefined)
  • CACHE_ANYTHING: Allows to use whatever cache provider is available (predefined)
  • CACHE_ACCEL: Allows to use "APC" as cache provider (predefined)
  • CACHE_MEMCACHED: Allows to use "memcached" as cache provider (predefined, requires additional setup on the server)
  • CACHE_DB: Allows to use the relational database backend as cache provider (predefined)
  • redis: Allows to use "Redis" as cache provider (custom, requires additional setup on the server)

Changing the default setting

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

Disable cache usage for Semantic MediaWiki
$smwgCacheType = CACHE_NONE;

This means that Semantic MediaWiki itself will not use any caching mechanism.

Use "memcached" as cache provider
$smwgCacheType = CACHE_MEMCACHED;
  • Additional setup on the wiki's server is required to be able to used this cache provider.
Use "redis" as cache provider
$smwgCacheType = 'redis';
  • Additional setup on the wiki's server as well as further configuration in "LocalSettings.php" is required to be able to used this cache provider.

This is the recommended cache provider.

See also

Caching in general
Query result caching
Other
#scite could not render a citation text for reference "gh:smw:fb2c917" because type "commit" was not assigned to a template.

References

  1. ^ gh:smw:fb2c917 
  2. ^  Why Redis beats Memcached for caching "... Memcached and Redis serve as in-memory, key-value data stores ... Redis gives you much greater flexibility regarding the objects you can cache. While Memcached limits key names to 250 bytes and works with plain strings only, Redis allows key names and values to be as large as 512MB ..."