Manual:$wgResourceLoaderMaxage

From mediawiki.org
This page is a translated version of the page Manual:$wgResourceLoaderMaxage and the translation is 61% complete.
ResourceLoader: $wgResourceLoaderMaxage
How long a CDN or browser may cache a ResourceLoader HTTP response.
導入されたバージョン:1.17.0 (r73568)
除去されたバージョン:使用中
許容される値:(配列)
既定値:下記参照

詳細

How long a CDN or browser may cache a ResourceLoader HTTP response. Maximum time in seconds. Used for the 'max-age' and 's-maxage' Cache-Control headers.

既定値

MediaWiki バージョン:
1.39
$wgResourceLoaderMaxage = [];
MediaWiki バージョン:
1.35 – 1.38
$wgResourceLoaderMaxage = [
	'versioned' => 30 * 24 * 60 * 60, // 30日間
	'unversioned' => 5 * 60 // 5分
];
MediaWiki バージョン:
1.17 – 1.34
$wgResourceLoaderMaxage = array(
	'versioned' => array(
		// クライアントと MediaWiki の間の、Squid/Varnish をはじめとするあらゆる公開プロキシのキャッシュ
		'server' => 30 * 24 * 60 * 60, // 30 days
		// クライアント側 (つまりブラウザーのキャッシュ)。
		'client' => 30 * 24 * 60 * 60, // 30 days
	),
	'unversioned' => array(
		'server' => 5 * 60, // 5分
		'client' => 5 * 60, // 5分
	),
);
This syntax is not compatible anymore. This happened after this change: phab:T235314

To simplify troubleshooting, here is a known exception related to this old syntax:

/load.php?lang=it&modules=skins.vector.styles.legacy%2Cresponsive&only=styles&skin=vector   Error from line 1073 of includes/resourceloader/ResourceLoader.php: Unsupported operand types
#0 includes/resourceloader/ResourceLoader.php(891): ResourceLoader->tryRespondFromFileCache(ResourceFileCache, ResourceLoaderContext, string)
#1 load.php(51): ResourceLoader->respond(ResourceLoaderContext)
#2 load.php(38): wfLoadMain()
#3 {main}

To fix this issue just migrate to the new syntax without the "server" and "client" distinction.

関連項目