Page MenuHomePhabricator

Uploading a newer version of a file; previous version cached by the browser, shown stretched to width/height of the new version
Closed, DuplicatePublic

Description

I recently updated File:JourneytothecenteroftimeDVDcover.JPG on English Wikipedia to crop out the white space seen in the previous version of the file. For some reason, after uploading the updated version, the updated version appeared "squashed sideways". That is, it looked somewhat like the file I've uploaded here as an example. It appeared to maintain its vertical size (240px), but its horizontal size (normally 165px) seemed squashed. I refreshed the file page, believing it to be a browser error, but nothing changed. I went to the page the image is used on and purged it so the most current version of the file would show up, and it appeared correctly, the way it was meant to show up. I then went to the file page again and purged it. This, for some reason, caused the image to appear normally. I am unsure of why the "squashed" version of the file even appeared, but I don't like the idea of users having to purge new uploads every now and then to get them to appear correctly, especially since many users don't even know they can purge pages.

Unfortunately, I didn't think to get any screenshots before I purged the file page. The image below is just a representation of what I saw and is not a screenshot of how the file appeared.

Event Timeline

Gestrid created this task.Nov 6 2016, 2:15 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 6 2016, 2:15 AM
Aklapper renamed this task from Problem with appearance of file after upload to Uploading a newer version of a file; some browsers keep width/height of previous version cached & stretch new version.Nov 6 2016, 7:17 PM
Restricted Application added projects: Multimedia, Commons. · View Herald TranscriptNov 6 2016, 7:17 PM
Tgr added a subscriber: Tgr.Nov 6 2016, 11:19 PM

The dimensions are specified in the HTML, so this is probably just a failure to auto-purge the article when the image was reuploaded. That happens once in a while. See T133821: Content purges are unreliable.

Restricted Application added subscribers: Poyekhali, Matanya. · View Herald TranscriptNov 6 2016, 11:19 PM

@Tgr I think this is the other way round, actually. The dimensions in the HTML were updated, but the URL https://upload.wikimedia.org/wikipedia/en/2/27/JourneytothecenteroftimeDVDcover.JPG was cached by the browser and still showing the old file. If you take the old version and scale it to 165 × 240, you get this, which matches the "mockup" in the report here:

The browser is acting correctly here, for the record, it's MediaWiki's browser cache handling that's broken.

A proper solution would be T149847: RFC: Use content hash based image / thumb URLs. Adding a cache-busting parameter to the URL (like the upload timestamp) would also work.

I wonder if this is a duplicate. This is definitely a known issue, but I'm not sure if a bug was ever filed for it.

matmarex renamed this task from Uploading a newer version of a file; some browsers keep width/height of previous version cached & stretch new version to Uploading a newer version of a file; previous version cached by the browser, shown stretched to width/height of the new version.Nov 7 2016, 8:02 PM
matmarex removed a project: MediaWiki-Uploading.