Last modified: 2014-02-12 23:53:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46126, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44126 - Performance: don't request watch status dynamically
Performance: don't request watch status dynamically
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Unprioritized major
: ---
Assigned To: Jon
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-18 21:11 UTC by Max Semenik
Modified: 2014-02-12 23:53 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Max Semenik 2013-01-18 21:11:39 UTC
On every page view we do GET /w/api.php?action=query&format=json&titles=Barack+Obama&prop=info&inprop=watched HTTP/1.1

It's absolutely unnecessary as pages aren't cached for logged-in users so we can output the watched status in the page HTML.
Comment 1 Jon 2013-01-18 22:03:11 UTC
I don't see what this gives us apart from more code fragmentation. Is this really a performance hit to the server?

Remember we dynamically load pages on beta and when this happens we will need to do an ajax call anyway to get watchlist status. This would mean we would need to special case against the first page load to do something different. I worry this will lead to clumsy javascript code.

It's worth noting that currently we don't show the watchlist star to users with older phones that we don't serve javascript to. It might be worth rendering the star in the html and making it a simple form post so that these users can still watch pages. This might be a good motivation to doing things this way.

Also surely we should be getting to a state where we __can__ cache logged in users page - we should be working towards that and I feel like this works against that direction... no?

Thoughts?
Comment 2 Jon 2013-01-18 22:05:00 UTC
Also to clarify 
"On every page view we do GET"
should actually read
"On every page view where a user is logged in we do a GET"
Comment 3 Asher Feldman 2013-01-28 23:50:50 UTC
An unnecessary roundtrip to api.php should be avoided if at all possible, its more expensive to invoke than it should be.  Logged in users do not generate api.php?action=query&prop=info&inprop=watched on every page view, and I think MobileFrontend should strive not to add additional request overhead vs. the standard site.  +1 to Max's approach here.
Comment 4 Tim Starling 2013-01-29 00:10:55 UTC
Note that ResourceLoader allows module responses to be embedded in the page HTML, for the purposes of improving the performance of logged-in page views. This is used, for example, to send user preferences. We're not currently working towards HTTP caching of logged-in page views.
Comment 5 Jon 2013-01-29 01:42:28 UTC
Thanks Asher and Tim for the input. Using ResourceLoader in this way seems to be the way to go.
Comment 6 Jon 2013-03-01 00:04:31 UTC
https://gerrit.wikimedia.org/r/51604

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links