Page MenuHomePhabricator

Add an image: parallelize requests
Open, Needs TriagePublic

Description

When the user visits the homepage, we do a task search and fetch and cache task data for the image recommendation tasks in the result set (which is by default all 20 of them). That's 20 Image Suggestion API requests and 20 * (number of suggested images) Commons API requests, currently all done sequentially. They don't block rendering, but they do result in some overhead in PHP workers, and the occasional timeout.

It would be relatively simple to do these in parallel - the Image Suggestion API supports fetching up to 200 pages at once, and the action API likewise supports batching. (FormatMetadata doesn't, but is heavily cached.)

Related Objects