Skip to content

Make sure relevant cache policy headers are sent #33

@magnusbaeck

Description

@magnusbaeck

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions