Page MenuHomePhabricator

Make "live update" not download the entire RC page every 3 seconds
Closed, ResolvedPublic

Description

Ideally we would use an API that only gives us the changes list, but for a quick and dirty solution we could at least add a parameter that returns only the changes list and none of the rest of the UI.

Event Timeline

Catrope created this task.Aug 18 2017, 11:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

What is being downloaded every 3 seconds is a page with

  1. the standard MW chrome
  2. the no-js RC form with show/hide toggles
  3. 0 or 1 recent change (because ?limit=1).

Note that contrary to a regular page load, none of the linked assets are being pulled.

By-passing #2 and #3 doesn't seem to have a noticeable effect on size and speed (tested locally with curl in a loop) but removing all of #1 might. Is there a way in MW to send a code and by-pass all the standard chrome and whatever is added to the output before or after?

By-passing #2 and #3 doesn't seem to have a noticeable effect on size and speed (tested locally with curl in a loop) but removing all of #1 might. Is there a way in MW to send a code and by-pass all the standard chrome and whatever is added to the output before or after?

https://en.wikipedia.org/wiki/Special:RecentChanges?useskin=apioutput

This is a special skin, which is actually intended for the human-readable API pages (e.g. https://en.wikipedia.org/w/api.php?action=query&list=allpages).

However, it turns out to work here.

This does mean the output isn't using the user's normal skin. I don't think that affects anything in the actual line being extracted, but I'm not 100% sure.

Change 376041 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/core@master] RCFilters: Live Update: download less data

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

Change 376041 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Live Update: download less data

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

Etonkovidova added a subscriber: Etonkovidova.EditedSep 8 2017, 12:34 AM

@SBisson
In betalabs I do not see 'Live updates' working. Also, 'View newest changes' does not work either. I was checking RC page with no filters at all to ensure that all changes will be displayed.

I checked test wiki and enwiki (wmf.17) - 'View newest changes' works there fine.

@SBisson
In betalabs I do not see 'Live updates' working. Also, 'View newest changes' does not work either. I was checking RC page with no filters at all to ensure that all changes will be displayed.

I confirm: "Live update" and "View newest" are not working in betalabs. The polling URL[1] returns 503 (works fine without peek=1)

I need to investigate why this works fine locally but not on betalabs. Maybe @Catrope has an idea?

If need be we can just remove the peek parameter before it goes live next week.

[1] https://en.wikipedia.beta.wmflabs.org/wiki/Special:RecentChanges?limit=1&days=7&urlversion=2&from=20170908130351&action=render&enhanced=0&peek=1

Change 377246 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/core@master] RCFilters: Live update: disable peek param

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

I only see a HTTP 503 in the case that should return a HTTP 304 – otherwise, I correctly get an empty page with HTTP 200. Perhaps our caching layer doesn't like the 304. Try just using a HTTP 200 always and instead returning the information in the body (e.g. a '1' or '0')?

Change 377246 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Live update: disable peek param

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

I only see a HTTP 503 in the case that should return a HTTP 304 – otherwise, I correctly get an empty page with HTTP 200. Perhaps our caching layer doesn't like the 304. Try just using a HTTP 200 always and instead returning the information in the body (e.g. a '1' or '0')?

Or a 204?

Change 377800 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/core@master] RCFilters: Live update: no data returns 204

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

Change 377800 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Live update: no data returns 204

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

Checked in betalabs - 204 is returned when there is no updated content.

Etonkovidova closed this task as Resolved.Sep 18 2017, 10:03 PM