Page MenuHomePhabricator

Simplify $wgResourceLoaderMaxage
Closed, ResolvedPublic

Description

From

Current
$wgResourceLoaderMaxage = [
	'versioned' => [
		'server' => 30 * 24 * 60 * 60, // 30 days
		'client' => 30 * 24 * 60 * 60, // 30 days
	],
	'unversioned' => [
		'server' => 5 * 60, // 5 minutes
		'client' => 5 * 60, // 5 minutes
	],
];
Proposed
$wgResourceLoaderMaxage = [
	'versioned' => 30 * 24 * 60 * 60, // 30 days
	'unversioned' => 5 * 60, // 5 minutes
];

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 542641 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/mediawiki-config@master] Remove unused wmgReduceStartupExpiry logic in CommonSettings.php

https://gerrit.wikimedia.org/r/542641

Change 542642 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/mediawiki-config@master] Remove wmgReduceStartupExpiry (no longer used)

https://gerrit.wikimedia.org/r/542642

Change 542641 merged by jenkins-bot:
[operations/mediawiki-config@master] Remove unused wmgReduceStartupExpiry logic in CommonSettings.php

https://gerrit.wikimedia.org/r/542641

Change 542738 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Simplify $wgResourceLoaderMaxage

https://gerrit.wikimedia.org/r/542738

Change 542642 merged by jenkins-bot:
[operations/mediawiki-config@master] Remove wmgReduceStartupExpiry (no longer used)

https://gerrit.wikimedia.org/r/542642

Krinkle triaged this task as Medium priority.
Krinkle moved this task from Inbox to Accepted Enhancement on the MediaWiki-ResourceLoader board.

Change 542738 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Simplify $wgResourceLoaderMaxage config

https://gerrit.wikimedia.org/r/542738

@Krinkle Is there anything else needed here?

That was it. Thank you.

WARNING: This is a breaking change. Maybe it's a surprise. Maybe not. Apologies if not.

I'm somehow sure that this change is the cause behind the breakup of some MediaWikis during their upgrade. This happens if the LocalSettings.php had the legacy syntax with server and client stuff.

Precisely, visiting and old wiki after a fresh upgrade, you will get a 500 Internal Server Error with this exception or something similar:

/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}

Now. I've updated the documentation here to simplify troubleshooting:

https://www.mediawiki.org/wiki/Manual:$wgResourceLoaderMaxage

But that is a good place to fix that issue but not to prevent it. What do you suggest to prevent it? Maybe this thing is already reported somewhere with very bold and scary warnings. Maybe not.

For additional context I encountered this issue when examining T268515: Upgrade wiki.wikimedia.it from 1.26.4 to latest LTS.

WARNING: This is a breaking change. Maybe it's a surprise. Maybe not. Apologies if not.

Just for cross-linking this is documented here:

https://www.mediawiki.org/wiki/Release_notes/1.35