Page MenuHomePhabricator

Remove "thumb size" preference
Closed, DeclinedPublic

Description

NOTE: removing the preference should only be done after the wikimedia community has been consulted.

Summary:
The "thumb size" option severely degrades performance for users who have it enabled and consumes cache capacity for little benefit. The feature itself is probably redundant to capabilities built into modern browsers. It is probably best to simply remove the option.

Context:
The "thumb size" option allows users to choose how big they see images in articles. It was presumably intended to allow users to customize page display to accommodate their screen size and available bandwidth.
We currently support eight different values between 120 and 400 pixel. The thumbnail size is applied Linker class used by the wikitext parser, appropriately scaled thumbnails are generated on upload (or on the fly if missing).

Problems:
Usually, the HTML generated by the wikitext parser is cached for later re-use. This is done because parsing is relatively slow - depending on the size and complexity of the page, it can take several seconds. However, when the "thumb size" option is used, this caching becomes ineffective: since there are a relatively large number of possible options, and relatively few people use them, the chances for a "cache miss" are high (cache fragmentation).

In effect, users that have "thumb size" set to a non-standard value are much more likely to hit an uncached page, forcing them to wait until the page has been rendered for them.

Generating image thumbnails in many different sized also clutters the on-disk cache on the media servers with scaled copies of images that are rarely used. This is particularly true because copies scaled to all possible thumbnail sizes is generated for all images, even if they are never used in an article (compare T106640).

Finally, the benefit of the option seems redundant. It is probably be better to rely on responsive image loading mechanisms available in modern browsers via the srcset attribute. MediaWiki already supports this, see https://www.mediawiki.org/wiki/Manual:$wgResponsiveImages.

Usage:
An ad-hoc analysis among users of en.wikipedia.org who have edited in the last 30 days shows that about 4% of active editors have the "thumb size" option set.

Solution:
If there is no great demand for this feature, we should simply remove it. If the feature is to be kept or replaced with a mechanism for adjusting the thumbnail size dynamically, it should be re-implemented in a way that prevents it from fragmenting the parser cache. This could be done by injecting the appropriate size parameter into the rendered output, using a mechanism similar to the one that we use for section edit links (this is currently done by the ParserOutput class).

Event Timeline

daniel renamed this task from Remove thumb size preference to Remove "thumb size" preference.Jun 14 2021, 11:30 AM

Implementing this would invalidate a bunch of tasks like T71973, T106640, etc

BPirkle triaged this task as Medium priority.Jun 22 2021, 9:03 PM
BPirkle moved this task from Inbox to Feature Requests to Review on the Platform Engineering board.

I think it would be helpful to:

  1. Add an explanation of the current default(s) into the task description.
    • (AFAICT from staring at our InitialiseSettings.php, they are 220px on almost all Wikimedia wikis (last changed in 2010, from 180px), with five exceptions: itwikiquote (360px), svwiki (250px), nlwiki (260px), fiwiki (250px), nowiki (250px). And I think the default for non-Wikimedia wikis is 300px. But I'm not certain.)
  2. Add an explanation into the task description for whether or not this proposed change would remove the technical ability to have different defaults for each Wikimedia wiki.

Finally, the benefit of the option seems redundant. It is probably be better to rely on responsive image loading mechanisms available in modern browsers via the srcset attribute. MediaWiki already supports this, see https://www.mediawiki.org/wiki/Manual:$wgResponsiveImages.

I don't think that option does what you think it does.... At least, I don't see how it is related to this ticket...

My only concern here is that showing thumbnails in a larger size might be valuable for vision-impaired users. At the other end of the spectrum, showing them in a smaller size might be valuable to people on exceptionally slow links and/or small screen sizes such as wearable devices.

I don't have any strong feeling that this feature needs to be kept, just wanted to note these two use cases to make sure they had been considered.

I wouldn't call 4% of active editors a small percentage, but I guess that's a judgement call. Please provide CSS (or whatever) instructions for the 4% of us who find the default thumbnail sizes too small and want to set our own thumbnail size.

I second the suggestion to check for what vision impaired users do: if, say, a quarter of all vision impaired users use larger thumbnail sizes, then although that is not a large percentage of all users, changing this would have a large impact on a specific group. In this case, should this option be removed, it would need to be replaced by a functionally equivalent accessibility enhancement. Accessibility is a core feature, not something of "little benefit".

I actually like this feature of being able to downsize images and utilise it, and it would be a shame to lose the functionaluty. I care not about stubs nor numbered headings.

@Billinghurst: Please see the initial task description (severely degrades performance, etc etc). If this issue matters to you, then an effective way to express this is to click Award Token. Writing a non-technical comment is not effective and does not move the conversation on: the more comments, the longer it takes to read the entire ticket, so it will be less likely for developers to find time to read everything. Thanks for your understanding.

Finally, the benefit of the option seems redundant. It is probably be better to rely on responsive image loading mechanisms available in modern browsers via the srcset attribute. MediaWiki already supports this, see https://www.mediawiki.org/wiki/Manual:$wgResponsiveImages.

I don't think that option does what you think it does.... At least, I don't see how it is related to this ticket...

The ideas was "if people change the setting to get higher resolution thumbnails because they have high resolution screens, this is better done via srcset". Is that incorrect?

I second the suggestion to check for what vision impaired users do: if, say, a quarter of all vision impaired users use larger thumbnail sizes, then although that is not a large percentage of all users, changing this would have a large impact on a specific group. In this case, should this option be removed, it would need to be replaced by a functionally equivalent accessibility enhancement. Accessibility is a core feature, not something of "little benefit".

Being able to load images in different resolutions is definitely useful. My thinking was that it is better to base this on screen size/resolution and page "zoom" level, rather than a user preference. My assumption was that people who want to see larger images would also increase font size ("zoom in").

But I agree that impact on vision impaired users needs to be investigated, and alternatives should be explored.

@Billinghurst: I just learned that ticket this was explicitly linked from Tech News. I apologize for my previous comment.

The ideas was "if people change the setting to get higher resolution thumbnails because they have high resolution screens, this is better done via srcset". Is that incorrect?

srcset is already provided for all images returned by MediaWiki. Also, srcset does not change the intrinsic size of the image, so all images would be 220px for everyone (on most wikis) if the setting gets disabled. Even resizing an image to 1.5x/2x size manually would not trigger srcset, you have to actually have a high-definition display. So, srcset is pretty much useless here.

The ideas was "if people change the setting to get higher resolution thumbnails because they have high resolution screens, this is better done via srcset". Is that incorrect?

No they change thumbnail size, because they want bigger images on their screen in relation to the text. srcset basically only deals with a hardware density vs the virtual pixel density, it doesn't effect how much the image occupies your screen.

Ideally, you want CSS to say "use 200%" images or 50% for that matter, but that's pretty hard, because of:

  1. upright parameter
  2. height limited and box limited sizing: x{height}px and {width}x{height}px that's actually explicit sizing, so wouldn't effect this I guess.
  3. thumb inner being bigger than the image itself (8px to be exact)
  4. thumbs needing to be width restricted because of caption wrapping
  5. fixed dimensions of things like audio/video player...

Maybe with dedicated classes like "large/medium/small" and then ship hardcoded pixel sizes for those classes, with upright based on calc() ? would require some experimentation to see if that is possible.

No they change thumbnail size, because they want bigger images on their screen in relation to the text. srcset basically only deals with a hardware density vs the virtual pixel density, it doesn't effect how much the image occupies your screen.

Thanks for making this more clear. So more research is needed before we can change the user facing behavior.

But we still want to fix the fact that using this feature fragments the parser cache and makes page views very slow for users with a non-default value selected for the thumbsize option.