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.
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-Sincewill be honored. There have got to be best practices for how to do this with FastAPI; maybe it’s worth looking at Starlette’sStaticFilesimplementation (which we also use for parts of the app).Spun off this issue from #87.