Page MenuHomePhabricator

[[meta:Logo#Temporary logo variants]] should not advertise local CSS overwriting
Closed, ResolvedPublic

Description

https://meta.wikimedia.org/wiki/Logo#Temporary_logo_variants covers how to temporarily change a wiki logo via CSS.

T200713#4479001 by @Urbanecm and T240797#5742670 by @Jdforrester-WMF imply that this is not the way to do it, but I don't know the exact reasons - some performance issues, I assume?

I'd like to rewrite part of that wiki page and would welcome your input on improving the this will create performance issues part in:

Do '''not''' overwrite the <code>.mw-wiki-logo</code> CSS class by editing the page <code><nowiki>MediaWiki:Common.css</nowiki></code> on the wiki - this will create performance issues. Instead, [[Requesting wiki configuration changes|request a configuration change]] (and feel encouraged to [[wikitech:Wikimedia site requests#Change the logo of a Wikimedia wiki|write that configuration change yourself]] if you are technically interested).

Event Timeline

@Urbanecm or @Jdforrester-WMF: Could you share your technical knowledge in a sentence or two why temporary CSS logo overrides aren't good, please?
Or maybe @Ladsgroup remembers, from the two edits in https://www.wikidata.org/w/index.php?title=MediaWiki:Common.css&diff=next&oldid=1040831214 ?

Afterwards I could update the docs. Thanks in advance!

Hello @Aklapper, when you use a CSS override, browsers need to download both logos, one from https://en.wikipedia.org/static/images/project-logos/enwiki.png, and the second from some other location. That means the logo-traffic for that project doubles.

Additionally, the /static folder is heavily cached, as the resources put there are supposed to be static. That means serving a file from /static folder is super-cheap, while a request to https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Necronomicon_prop.jpg/200px-Necronomicon_prop.jpg.png is much more expensive.

I hope this makes sense.

browsers need to download both logos

I am not sure it is a problem. The main logo is likely already cached in most people's browsers, and the other logo is not bigger than literally any image in any article. Either people save traffic by having images disabled completely, or downloading another 250px or so picture is not an issue for them.

while a request to https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Necronomicon_prop.jpg/200px-Necronomicon_prop.jpg.png is much more expensive.

Is this different when a CentralNotice campaign is using an image? Is this causing some known problems?

It seems that there is very small theoretical gain toppled with overhead of having to deal with patches, deployments and other things (not to mention the language barrier). Temporary logos are often timed very strictly e.g. they have to be put on as soon as a certain amount of edits is reached or at exactly midnight of a project birthday and removed at exactly midnight next day. This is nowhere the precision deployment trains or even direct meddling with configuration can provide.

It is recommended you file a request at least a week in advance of wanting to change logos

From the current documentation is just impossible for some communities. For example Ukrainian Wikipedia had a logo contest for its birthday related activities which has just started 3 or so day ago and ended yesterday, the activities begin in 3 days. The WP20 temporary logo was approved less than a week before the date, etc.

browsers need to download both logos

I am not sure it is a problem. The main logo is likely already cached in most people's browsers, and the other logo is not bigger than literally any image in any article. Either people save traffic by having images disabled completely, or downloading another 250px or so picture is not an issue for them.

I think it's more that we have the opportunity and ability to cut it down and therefore we should. I don't think it would be proper to ask users to include less images, but the logo is part of the interface and should be optimized like the rest of the interface to be as minimal as possible.

while a request to https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Necronomicon_prop.jpg/200px-Necronomicon_prop.jpg.png is much more expensive.

Is this different when a CentralNotice campaign is using an image? Is this causing some known problems?

No, a CN banner would have the same issue, but that's not something I'm really familiar with to make a good recommendation. Yes, where possible we should optimize those kinds of images.

It seems that there is very small theoretical gain toppled with overhead of having to deal with patches, deployments and other things (not to mention the language barrier). Temporary logos are often timed very strictly e.g. they have to be put on as soon as a certain amount of edits is reached or at exactly midnight of a project birthday and removed at exactly midnight next day. This is nowhere the precision deployment trains or even direct meddling with configuration can provide.

It is recommended you file a request at least a week in advance of wanting to change logos

From the current documentation is just impossible for some communities. For example Ukrainian Wikipedia had a logo contest for its birthday related activities which has just started 3 or so day ago and ended yesterday, the activities begin in 3 days. The WP20 temporary logo was approved less than a week before the date, etc.

That was more of a recommendation in the sense of if you give us a week's notice, we'll definitely make sure it happens. If we get less notice, we'll still do our best but stuff does occasionally fall through the cracks. In any case, if there are special requirements or timing requests, we can discuss it but most of the time I think we can fulfill them when asked. My goal as a sysadmin is to implement/serve what you all want while taking care of performance, etc.

I think it's more that we have the opportunity and ability to cut it down and therefore we should. I don't think it would be proper to ask users to include less images, but the logo is part of the interface and should be optimized like the rest of the interface to be as minimal as possible.

We are talking about around 50 KB of data that gets cached on browser side the moment it loads. By saving English Wikipedia Main page I get 1,2 MB of data. So we are talking about around 4% data increase on a first load that does not affect subsequent loads unless someone has disabled their browser caching. I agree that on expensive and slow mobile internet it might still make difference, I have had my share of GPRS/CSD internet access on my Symbian smartphone a decade ago, but I do not believe that this is a factor in 2021. As I said before people that do care about traffic volumes usually just disable the images altogether.

No, a CN banner would have the same issue, but that's not something I'm really familiar with to make a good recommendation. Yes, where possible we should optimize those kinds of images.

In such case I do not think you are being any fair at all. CentralNotice is actively used on production and results in millions of impressions. It has a lot of issues, but as far as I am aware server caused by images being used is not one of them.

And then, you would have better access to analytics tools to verify it, but I am fairly sure that e.g. https://commons.wikimedia.org/wiki/File:Flag_of_the_United_States.svg which is used on tens of thousands of pages accross almost all Wikimedia projects (except e.g. English Wikipedia that has its own copy for reasons that are a different topic) causes more load than both CN and a custom logo produce combined.

My goal as a sysadmin is to implement/serve what you all want while taking care of performance, etc.

I appreciate that, but unfortunately system administrators are only one stakeholder in this problem. I am not convinced that the interests of system administrators should be put on top of interests of the communities.

At the moment there are two options: the CSS change that is guaranteed to work but that has some minute server load increase. On the other hand we have system being promoted here which results in situations like T240797 where the author had to drop the idea altogether because of poor communication from both sides, or T186455 / T117139 where CSS was used in the end.

I don't think I'd dare to make assumptions about "common" device capacities in all societies on this planet (or how much money I'm [not] able to spend to get some "smartphone"), or that I'd usually disable images altogether just because I have some data plan with a limited amount of MBs per month. Plus things sum up when it comes to overall performance. Surely there are other images used on many pages which cause load; if you see ideas to reduce that load feel free to share them.

The static logos might be heavily optimised and cached, but images served on-the-fly from Commons definitely aren't.

or how much money I'm [not] able to spend to get some "smartphone"

I am not sure what your personal budget has to do with this ticket.

Plus things sum up when it comes to overall performance.

They do, but when it comes to the solutions to decrease the load the choices have to be made wisely. For instance one might suggest limiting article size to 10 kB max, and it will make all articles load faster. Would anyone benefit from such change? Sysadmins — possibly, anyone else — hardly. What is suggested here is what Russian expression экономия на спичках describes well.

Well, in that case I'm not sure why you brought up your 'old' smartphone if it's already become irrelevant in your next comment. :)