Page MenuHomePhabricator

Support compression with MW API (api.php)
Closed, DeclinedPublic

Description

There could be an option for every single API to compress the output, whatever format it uses (XML / JSON / BrainFuck) using some widely supported open source algorithms, such as gzip, bzip, and similar.

That way the RAW traffic needed to be communicated between the server and client would be vastly reduced.

My idea:

Client request api: https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&format=xml&compression=gzip

Server prepares a standard XML output and before printing it out (sending to client through http) it compress the whole string using requested compression algorithm

I /think/ this should be trivial to implement and could save some traffic. Especially useful for users with poor internet connectivity. I know that compression requires extra CPU, but WMF doesn't really seem to care given the wide enforcement of SSL, which is vastly useless and requires similar amount of CPU here.

Event Timeline

Petrb raised the priority of this task from to Needs Triage.
Petrb updated the task description. (Show Details)
Petrb added a project: MediaWiki-Action-API.
Petrb subscribed.
Anomie claimed this task.
Anomie subscribed.

See the Accept-Encoding HTTP header.