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 view broken with Kolibri 0.16.0-beta6 #872

Closed
dbnicholson opened this issue Oct 5, 2023 · 2 comments · Fixed by #873
Closed

Channel view broken with Kolibri 0.16.0-beta6 #872

dbnicholson opened this issue Oct 5, 2023 · 2 comments · Fixed by #873
Assignees

Comments

@dbnicholson
Copy link
Member

This was originally endlessm/kolibri-installer-android#190. Currently, AppView is using metadata_cache. That causes an exception in 0.16.0-beta6 because metadata_cache was changed to handle the cache value itself instead of letting the Django middleware do it. The problem is that AppView is a regular Django View without a render callable.

That's a Kolibri bug that I'll report upstream. Fortunately, it should be easy to fix downstream as that's abusing metadata_cache, anyways.

@dbnicholson dbnicholson self-assigned this Oct 5, 2023
dbnicholson added a commit that referenced this issue Oct 5, 2023
The Kolibri `metadata_cache` decorator is tied to the content lifetime,
but that has nothing to do with the channel app data. Furthermore,
`metadata_cache` in Kolibri 0.16.0-beta6 is broken for this usage since
regular `View` classes don't have `render` functions.

Instead, simply use the `cache_control` decorator to set `max-age=600`.
This caches the responses for 10 minutes. Even though these are likely
very static, I don't want to set these longer for now since we have no
control over when the apps bundle gets updated.

Fixes: #872
dbnicholson added a commit that referenced this issue Oct 6, 2023
The Kolibri `metadata_cache` decorator is tied to the content lifetime,
but that has nothing to do with the channel app data. Furthermore,
`metadata_cache` in Kolibri 0.16.0-beta6 is broken for this usage since
regular `View` classes don't have `render` functions[1].

Instead, simply use the `cache_control` decorator to set the max age for
a week. Since these URLs always contain the plugin version (and the
files in the channel zips are generally cache busting), it should be
safe to essentially never expire the responses.

Fixes: #872

1. learningequality/kolibri#11362
@dbnicholson
Copy link
Member Author

This was released in 7.7.0 and is in all the apps.

@vanessa-chang
Copy link

Verified passed in Chromebook 7.8-415 | Flatpack v0.7 10-16 | Windows 7.8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants