learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
779 stars 647 forks source link

Optimise Library page load time when channels have large Thumbnail #12530

Closed thesujai closed 1 month ago

thesujai commented 2 months ago

Summary

As mentioned in the issue this PR does the following changes:

  1. Defines a new API endpoint to get the channel_thumbnail as a img file
  2. Changes the Current internal ChannelMetaData endpoint to return a URL to thumbnail instead directly returning a base64 encoded URL. This will cause async loading for thumbnails in the frontend

ScreenCast Screencast from 02-08-24 01:44:04 PM IST.webm

References

Fixes #12502

Reviewer guidance

Open the library page and observe the channels load immediately, but the corresponding thumbnails loads asynchronously


Testing checklist

PR process

Reviewer checklist

github-actions[bot] commented 2 months ago

Build Artifacts

Asset type Download link
PEX file kolibri-0.17.0a0.dev0_git.11.gc1417e39.pex
Windows Installer (EXE) kolibri-0.17.0a0.dev0+git.11.gc1417e39-windows-setup-unsigned.exe
Debian Package kolibri_0.17.0a0.dev0+git.11.gc1417e39-0ubuntu1_all.deb
Mac Installer (DMG) kolibri-0.17.0a0.dev0+git.11.gc1417e39.dmg
Android Package (APK) kolibri-0.17.0a0.dev0+git.11.gc1417e39-0.1.4-debug.apk
TAR file kolibri-0.17.0a0.dev0+git.11.gc1417e39.tar.gz
WHL file kolibri-0.17.0a0.dev0+git.11.gc1417e39-py2.py3-none-any.whl
thesujai commented 1 month ago

@rtibbles can you take another look?

thesujai commented 1 month ago

I made the changes. You can do the manual testing. Now I can observe that when the library page loads, individual HTTP requests are made to get the thumbnail. The Other libraries section which I suppose makes requests to the public endpoint is not affected by this change, as I see a base64 encoded thumbnail returned in the browser network tab. That is the desired behavior for now.

radinamatic commented 1 month ago

cc @pcenov

pcenov commented 1 month ago

@radinamatic - no issues observed while manually testing, implemented as specified. Good to go!