Channel thumbnails can cause extreme slowdown of channel API call #12502
Labels
APP: Learn
Re: Learn App (content, quizzes, lessons, etc.)
DEV: backend
Python, databases, networking, filesystem...
P1 - important
Priority: High impact on UX
Milestone
Observed behavior
When loading the available channels in Kolibri, the inclusion of the thumbnails in the API response can cause it to be very large, blocking page rendering. Without the thumbnails, a 1.6MB API payload can be reduced to less than 6KB. This is a significantly larger saving than just gzipping the payload, which reduces by about 25%.
Expected behavior
Instead of returning the thumbnails as base64 encoded images, the internal channelmetadata API endpoint should return a URL for a new view that reads the contents of the the thumbnail column of the channel metadata table, and returns the content as a file response.
This will allow the thumbnails to be loaded in a non-blocking way allowing significantly faster load times wherever channels are loaded.
N.B. For now this should not affect the public channel metadata endpoints, as older Kolibris will still expect the base64 encoded version. A follow up issue will be filed to better handle this for the public APIs.
User-facing consequences
Getting rid of timeouts on the library page when users have lots of channels with large thumbnails.
Context
Kolibri version 0.16.2, with many channels with large thumbnails installed.
The text was updated successfully, but these errors were encountered: