$smwgSetParserCacheKeys

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgSetParserCacheKeys
Description Controls whether the parser cache is fragmented by the viewer's interface language
Default setting
[ 'userlang' ]
Software Semantic MediaWiki
Since version
Until version still available
Configuration Cache settings
Keyword parser cache · cache · fragmentation · performance


$smwgSetParserCacheKeys is a configuration parameter that controls whether Semantic MediaWiki fragments the parser cache by the viewer's interface language. The only supported key is 'userlang'. With it present (the default), Semantic MediaWiki records the userlang parser cache option so that output which depends on the interface language, such as query errors and localized tooltips, is cached separately per language. Language-neutral output is shared across all interface languages regardless of this setting. The configuration parameter was introduced in Semantic MediaWiki 5.1.0Released on 24 July 2025 and compatible with MW 1.39.0 - 1.43.1..

As of Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x., Semantic MediaWiki fragments the parser cache by interface language only for output that actually depends on it: query results whose format is language-neutral, and in-text annotations whose rendered output is language-neutral, are cached once and shared across all interface languages.1 The 'dateformat' key was removed at the same time and is no longer recognized: Semantic MediaWiki formats dates by language rather than by the user's date-format preference, so fragmenting by 'dateformat' produced no benefit.2

Default setting[edit]

$smwgSetParserCacheKeys = [ 'userlang' ];

This means the parser cache is fragmented by the viewer's interface language, but only for output that depends on it.

Changing the default setting[edit]

To modify this configuration parameter, add the following line to your "LocalSettings.php" file:

Do not fragment the parser cache by interface language
$smwgSetParserCacheKeys = [];

On a monolingual wiki this has no effect. On a multilingual wiki it disables per-language fragmentation, so language-dependent output such as a localized error or tooltip may be served in the interface language of whoever first populated the parser cache.

See also[edit]


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:6948
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:6819