Page MenuHomePhabricator

Add button to Index edit form to prefetch all image thumbs
Open, Needs TriagePublic

Description

In order to speed up the experience of the PageList widget, we'll add a button that fetches thumbnails (1024 size) of all images in the pagelist. This will warm up the Thumbor cache.

Run an imageinfo API request for each page, to get the thumb URL, then send a HEAD request for that URL (unless it turns out that the imageinfo is enough? Investigation needed).

Creating-Index-Test-pdf-Dev-wiki1.png (506×1 px, 118 KB)

Event Timeline

This sounds super interesting and should be super useful as well.

I actually started a personal project to try this out due to frustration with the thumbnails while pagelisting. I didn't get very far, but I did run into the 70 images/30 seconds rate limit fairly quickly.

I also have the https://en.wikisource.org/wiki/User:Inductiveload/index_preview script which is similar, but it does a GET on the image as it will actually display it.

I think it's possible that doing this from the server side with the thumbnail render queue, rather than the client side, will be better.

@Inductiveload Is the rate limit documented anywhere? Also, with the new zooming and panning system, we are loading 1024, 1024 * 1.5, 1024 * 2 resolution images (as the user zooms in)... It's going to slow things down in the PagelistWidget by quite a bit especially since I'm guessing rendering the higher resolution images will take a lot more time.

@Soda the rate limit is documented in https://noc.wikimedia.org/conf/highlight.php?file=InitialiseSettings.php (look for wgRateLimits).

It might be worth asking for a bump for the Wikisources anyway, regardless of the method used in this task?

WRT the zooming, you may want to note that for many files, especially PDFs, you might be requesting a 2048px image, but you will only get a PDF rendering at 150dpi (note that many IA PDFs are natively ~500dpi) that's been upscaled to 2048px (see T224355). So all you get is a bigger image, not a better one.