Page MenuHomePhabricator

Feature request: "clearyourcache" message should only show information for the specific browser being used (instead of all browsers)
Open, Stalled, Needs TriagePublic

Description

https://translatewiki.net/wiki/MediaWiki:Clearyourcache/en

Could the clearyourcache message be changed based on what browser you're using, instead of showing how to clear the cache for every browser? It would make it less cluttered, especially for wikis (which?) that don't put it into a list and instead have it as a block of text.

For example, if you're using Firefox, the message would be

Note: After publishing, you may have to bypass your browser's cache to see the changes. You can do this in your browser by holding down the Shift key while clicking Reload (or by pressing Ctrl-Shift-R). For details and instructions about other browsers, see Wikipedia:Bypass your cache.

instead of (current default, as of 2024):

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (โŒ˜-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (โŒ˜-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.

See also:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
xSavitar removed a project: User-xSavitar.

Change 471558 abandoned by D3r1ck01:
Make clearyourcache i18n message browser based

Reason:
No longer working on this!

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

I am workin on this task as part of IIIT-Hyderabad wiki hackathon

@Nemoralis: I doubt that this is so important for everyone out there that it justifies User-notice?

@Nemoralis: I doubt that this is so important for everyone out there that it justifies User-notice?

I don't think so? @Quiddity what do you think about this?

A magic word output of the user's browser would allow this. Would it impact caching?

Quiddity removed a project: User-notice.

Re: User-notice - I agree this is probably not suitable for Tech News. (I.e. There are hundreds of regular improvements to MediaWiki which are great but are not worth distracting everyone with announcements about).

Re: The task itself - I think the Description was unclear, and I've attempted to clarify it a bit.
However, it's still not great, as the proposed replacement-message currently:

  • references a page that isn't available on most wikis (Wikipedia:Bypass your cache -- This is only on 18 wikis),
  • and it doesn't mention the OS-variant, e.g. for Firefox on Mac users.
    • Plus it's unclear whether this task would (or should) also include OS-detection (and string-customization) as well as Browser-detection.

Overall, I'd recommend just declining this task, and instead just replacing the current default message with the more concise version that is used in some wikis (e.g. Enwiki) that provides a single-command for all browsers/OSes. I.e. https://en.wikipedia.org/wiki/MediaWiki:Clearyourcache -- (without the final sentence) -- Keep It Simple!

Change #1106931 had a related patch set uploaded (by Anirudh_K; author: Anirudh_K):

[mediawiki/core@master] Implement browser-specific cache-clearing instructions Bug ID--T195229

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

Change #1106931 abandoned by Anirudh_K:

[mediawiki/core@master] Implement browser-specific cache-clearing instructions Bug ID--T195229

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

Hi, I am Anirudh. Actually, I am very new to this but want to do more contributions, and I have tried to contribute to this mediawiki/core. Sorry for abandoning 3 times. Please guide me and check this patch.

Thank You

Change #1107032 had a related patch set uploaded (by Anirudh_K; author: Anirudh_K):

[mediawiki/core@master] Implement browser-specific cache-clearing instructions

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

Agreed with Quiddity above that it seems unnecessary to add and maintain 4 different messages for different browsers, especially since enwiki's localisation ("Hold down the Shift key and click the ''Reload'' toolbar button.") appears to work across all major browsers.

I think you don't get the problem statement properly. It's a different you are telling about and the issue is different. First read the description properly.

Change #1107087 had a related patch set uploaded (by Aditya0545; author: Aditya0545):

[mediawiki/core@master] core: implement browser-specific cache-clearing instructions

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

Change #1107336 had a related patch set uploaded (by UtsavSingh2824; author: UtsavSingh2824):

[mediawiki/core@master] clearyourcache:message should only show information for the specific browser Fix:Fixed the code now working Bug:T195229

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

This is now third commit for same thing. Can anyone from indic hackathon stop this?

Change #1107336 had a related patch set uploaded (by Pppery; author: UtsavSingh2824):

[mediawiki/core@master] clearyourcache message should only show information for the specific browser

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

Change #1107336 had a related patch set uploaded (by UtsavSingh2824; author: UtsavSingh2824):

[mediawiki/core@master] clearyourcache:message should only show information for the specific browser Fix:Fixed the code Bug:T195229

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

At least if everyone is trying to solve the same non-problem, it means they're not damaging anything else...

Change #1107336 had a related patch set uploaded (by Jdlrobson; author: UtsavSingh2824):

[mediawiki/core@master] Notifications: only show information for the specific browser

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

Jdlrobson renamed this task from "clearyourcache" message should only show information for the specific browser being used (instead of all browsers) to Feature request: "clearyourcache" message should only show information for the specific browser being used (instead of all browsers).Jan 2 2025, 7:08 PM

Change #1107087 abandoned by Jdlrobson:

[mediawiki/core@master] core: implement browser-specific cache-clearing instructions

Reason:

Duplicate of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1107336 - please see comments there, we should not be approaching this problem in this way.

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

Change #1107032 abandoned by Jdlrobson:

[mediawiki/core@master] Implement browser-specific cache-clearing instructions

Reason:

Thanks for the contribution. Please see my comment on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1107336 on suggested next steps and please see other feedback on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/471558

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

This is now third commit for same thing. Can anyone from indic hackathon stop this?

@Nemoralis: just to clarify that this was not at the Indic Wikimedia Hackathon, as the hackathon was over on Dec 22. It probably is related to another activity.

@Jdlrobson I have updated i18n/en.json file , Can u tell me how can i access the i18n/en.json file
i have added this line in notification.js but its not accessing en,json file
const message = mw.message( messageKey ).parse();

Could you pls help me

@UtsavSingh2824: Please see the review comment in your Gerrit patch; please discuss the code in Gerrit.

Change #1107336 had a related patch set uploaded (by UtsavSingh2824; author: UtsavSingh2824):

[mediawiki/core@master] clearyourcache:message should only show information for the specific browser Fix:Fixed code Bug:T195229

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

Jdlrobson changed the task status from Open to Stalled.Jan 6 2025, 5:50 PM

@Aklapper @UtsavSingh2824 I don't think anyone should be posting patches to this task given all the feedback on all the many patches we've had for this problem. I am marking this ticket as stalled until we can agree on an approach, preferably with design input.

Copying my comment on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1107336:

Thanks for the contribution and the idea, but this is the wrong place for this code - the notifications library is a generic library that is loaded on most page views, and the clear your cache banner is only loaded on certain pages.

I think the challenge here is that due to how wiki pages are cached, browser detection must be done on the client and the message must be printed on the server.

https://gerrit.wikimedia.org/g/mediawiki/core/+/ae17cac5664518708ba49849675640b75f116e22/includes/page/Article.php#786

I would consider approaching this from a design perspective. Perhaps the message could instead be modified to have icons for different browsers which when clicked provided further information.

I don't think this is the correct way to solve this problem and would encourage more discussion on the ticket before continuing.

Change #1183253 had a related patch set uploaded (by Tejashxv; author: Tejashxv):

[mediawiki/core@master] T195229: Show browser-specific 'clearyourcache' message

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

Could this task please be removed from RoadToWiki's list of tasks to work on? It seems to be too complicated to be part of that program since most students attempting it aren't getting it right.

Change #1183261 had a related patch set uploaded (by Tejashxv; author: Tejashxv):

[mediawiki/core@master] T195229: Previously only the generic 'clearyourcache' message was rendered. Now all browser-specific variants (default, Firefox, Safari, Chrome, Edge) are output server-side using i18n message keys. A client-side script then detects the browser via avigator.userAgent and displays the matching message while hiding the others.

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

Change #1183265 had a related patch set uploaded (by Tejashxv; author: Tejashxv):

[mediawiki/core@master] T195229: Add missing documentation for cache-clear messages in qqq.json

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

Change #1183284 had a related patch set uploaded (by Tejashxv; author: Tejashxv):

[mediawiki/core@master] T195229: added the missing documentation entries for the four browser-specific cache clearing messages

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

Tejashxv subscribed.

Change #1183265 abandoned by Tejashxv:

[mediawiki/core@master] T195229: Add missing documentation for cache-clear messages in qqq.json

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

Change #1183253 abandoned by Tejashxv:

[mediawiki/core@master] T195229: Show browser-specific 'clearyourcache' message

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

Change #1183261 abandoned by Tejashxv:

[mediawiki/core@master] T195229: Output browser-specific 'clearyourcache' messages

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

Change #1183284 abandoned by Tejashxv:

[mediawiki/core@master] T195229: Add documentation for browser-specific cache clearing messages

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