Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel thumbnails can cause extreme slowdown of channel API call #12502

Closed
rtibbles opened this issue Jul 30, 2024 · 3 comments
Closed

Channel thumbnails can cause extreme slowdown of channel API call #12502

rtibbles opened this issue Jul 30, 2024 · 3 comments
Assignees
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: backend Python, databases, networking, filesystem... P1 - important Priority: High impact on UX

Comments

@rtibbles
Copy link
Member

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.

@rtibbles rtibbles added P1 - important Priority: High impact on UX DEV: backend Python, databases, networking, filesystem... APP: Learn Re: Learn App (content, quizzes, lessons, etc.) labels Jul 30, 2024
@thesujai
Copy link
Contributor

thesujai commented Aug 1, 2024

@rtibbles May i work on this?

@rtibbles
Copy link
Member Author

rtibbles commented Aug 1, 2024

Sure - happy to see you give it a go!

@rtibbles
Copy link
Member Author

rtibbles commented Aug 8, 2024

Fixed in #12530 - thank you @thesujai !

@rtibbles rtibbles closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: backend Python, databases, networking, filesystem... P1 - important Priority: High impact on UX
Projects
None yet
Development

No branches or pull requests

2 participants