Page MenuHomePhabricator

window beforeunload and unload break/change back/forward cache.
Closed, ResolvedPublic


I remember we have these in MW, and I've just learned that this affects the caching strategy of modern browsers.
I/We should evaluate if we have this problem.

Event Timeline

TheDJ created this task.Feb 17 2015, 12:43 PM
TheDJ claimed this task.
TheDJ raised the priority of this task from to Needs Triage.
TheDJ updated the task description. (Show Details)
TheDJ added a project: JavaScript.
TheDJ added a subscriber: TheDJ.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 17 2015, 12:43 PM

See for more information about this in Internet Explorer (It will be shown when opening F12 and browsing on wikipedia with IE11). Using https also breaks it, so beforeunload is not a big problem (for logged in users)

mediawiki.confirmCloseWindow.js says: "remove the handler while the alert is showing - otherwise breaks caching in Firefox (3?).", so somebody at least evaluated this problem in the past (see T24680), though I don't know whether the solution still works in current browsers.

Aklapper triaged this task as Low priority.Feb 18 2015, 9:31 AM
Aklapper added a project: MediaWiki-General.
TheDJ added a comment.Feb 19 2015, 2:21 PM

LQT does this incorrectly it seems.
Can be fixed quite easily by replacing with mw.confirmCloseWindow.

The preferences page was doing this correctly, but with code duplication. Addressed with

TheDJ closed this task as Resolved.Feb 24 2015, 7:36 PM

I think we don't really care about LQT right ?
I'll close this. Can always be reopened if required.