learningequality / studio

Content curation tools for Kolibri
https://studio.learningequality.org/
MIT License
91 stars 156 forks source link

Add caching headers to existing Kolibri public APIs #3973

Open bjester opened 1 year ago

bjester commented 1 year ago

Background

We're adding new V2 APIs from Kolibri to Studio, and we're adding Cloudflare page rules to make sure that we can obtain optimal caching of the API responses

Desired behavior

The existing /api/public endpoints:

Current behavior

These endpoints do not return or support caching

Value add

Better edge caching through Cloudflare, meaning better worldwide browsing of public channels through Kolibri.

alphaket14 commented 1 year ago

Hi, @bjester . I'm new to studio and would like to start my journey with this issue. I understand this issue but don't know much about edge caching. So can you please guide me to know about them and help to find the right files which need to be changed under this issue? Thanks :)

bjester commented 1 year ago

Hi @alphaket14, thank you for your interest. Here are some details:

bjester commented 1 year ago

@alphaket14 Apologies, I forgot one thing. There is a caching decorator that should exist in the kolibri-public branch which you can look at for similar functionality https://github.com/learningequality/studio/blob/5e1316963c4a5937d376dcddcb2d9cd887b8e672/contentcuration/kolibri_public/views.py#L54

rtibbles commented 1 year ago

One other thing to note is this comment about how we handle caching for as yet unrecognized device versions in the Info endpoint - we should follow the recommendation of @bjester here: https://github.com/learningequality/studio/pull/3987#discussion_r1137474248 and disable the caching headers conditionally when we have an unrecognized device info version.

bjester commented 1 year ago

Hi @alphaket14, just checking in that you're indeed intending to address this?

alphaket14 commented 1 year ago

Hi @bjester , I was facing issue during the wsl local setup of /studio branch, The issue was this : [(https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker) ] Although I had docker desktop running, This occurred when I tried running the command : make run-services image

Then I dual booted my PC with ubuntu 22.04, currently setting up the local development Will contact you very soon, and yes I am intending to solve this problem

alphaket14 commented 1 year ago

image @bjester I am not able to resolve this issue, can i get some help This occured when I made the make run-services

This time docker daemon was running image Also the error mentioned module celery is also present image

ozer550 commented 1 year ago

Hi @alphaket14, thanks for showing your interest in this issue. Currently this issue is a priority for the next release and hence I would be picking this up to work on with. I understand that setting up studio can be a bit overwhelming at first and may need some time as you may run into issues. I would suggest instead try setting up the Kolibri as it is a bit easier than studio, kolibri also has many open issues that may be good to help with. You can take your time and explore other issues that are open in studio too.