| Status: | effective |
| Progress: | 100% |
| Version: | 7.0.0+ |
$smwgSetParserCacheKeys
| 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..
'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]
- Help page on configuration parameter
$smwgSetParserCacheTimestampNo description was provided. - Help page on configuration parameter
$smwgMainCacheTypeSets which object cache Semantic MediaWiki should use to track temporary changes
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:6948
- ^ Semantic MediaWiki: GitHub pull request gh:smw:6819