Skip to content

Add caching headers to HTTP endpoints that benefit from it #113

@scy

Description

@scy

Some of the HTTP endpoints, especially those serving (fairly) static data (e.g. blobs, translations) should have caching headers added to them, so that the client doesn’t use its own heuristics or re-request them as often.

Blobs have an ETag field in the database that can be used (it will be updated automatically whenever the blob’s content changes, which would probably happen fairly rarely (if at all) in production.

This caching behavior should also make sure that request headers like If-Modified-Since will be honored. There have got to be best practices for how to do this with FastAPI; maybe it’s worth looking at Starlette’s StaticFiles implementation (which we also use for parts of the app).

Spun off this issue from #87.

Metadata

Metadata

Assignees

Labels

area:backendRelated to the server componentprio:CNice to have, but optionaltype:enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions