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

Make sure relevant cache policy headers are sent #33

Open
magnusbaeck opened this issue Feb 11, 2022 · 0 comments
Open

Make sure relevant cache policy headers are sent #33

magnusbaeck opened this issue Feb 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@magnusbaeck
Copy link
Member

Description

We're currently not sending any cache policy headers in the query responses, and we probably should. For example, a query for an event with a particular ID should be highly cacheable. Maybe not indefinitely (sites may choose to delete events) but certainly for a while. Maybe it should be configurable? Not sure if there are other cases where we can determine that a query result won't change over time. Maybe not, but think about it.

Similarly, if there are queries whose results are clearly not cacheable we should state that in cache policy headers.

Motivation

This would allow proxies to cache responses to frequent queries to decrease the load in the Goer service and the underlying database.

Exemplification

If I have a service that frequently makes particular lookups I wouldn't have to implement custom caching internal to the application but could just set up a standard caching proxy (Varnish, NGINX, ...) and route outbound requests through it.

Benefits

Paving the way for better caching improves latency for clients and decreases the load on Goer.

Possible Drawbacks

None.

@magnusbaeck magnusbaeck added the enhancement New feature or request label Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant