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

needs Cache-Control headers with max-age #183

Open
reedstrm opened this issue Jan 11, 2017 · 4 comments
Open

needs Cache-Control headers with max-age #183

reedstrm opened this issue Jan 11, 2017 · 4 comments

Comments

@reedstrm
Copy link
Contributor

In order to effectively cache the results of exercise look ups, it would be good if the server, in addition to providing ETags and supporting If-None-Match (which it does), would provide a cache-control header with a reasonable value, fairly large, since exercises do not change often.

@reedstrm
Copy link
Contributor Author

current value is 'max-age=0, private, must-revalidate', which I think actually saves 0 time. In my measurements of If-None-Match vs. full fetches of exercises, I get the same total fetch time.

@Dantemss
Copy link
Member

Dantemss commented Jan 12, 2017

Yeah weak ETags like we use would only save the data transmission time which is tiny with a fast internet connection in comparison to the time it takes to generate the JSON.

I created a change request ticket to improve the cache headers and cache the result JSON somewhere: https://trello.com/c/ZNuzEBDK

@nathanstitt
Copy link
Member

this is good but I think it'll only help us in the rare case of a web-browser download.

For instance I'm not seeing how the the Tutor importer could supply a meaningful only-if-modified-since header.

@Dantemss
Copy link
Member

ETags already work :) Only Cache-Control still needs to be added. I think for published exercises we can set it to 1 year.

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

No branches or pull requests

3 participants