Skip to content

Revisit caching headers and etags for our endpoints #1465

@brontolosone

Description

@brontolosone

Once getodk/central-backend#1654 is in place we can use the counters as etags in the way analogous with getodk/central-backend#1657 at other endpoints.
Not for all endpoints of course. getodk/central-backend#1654 is not "one size fits all", it doesn't fit all use cases, but hopefully it'll fit many . For more info on that, see this elaboration of where it sits on a spectrum.

Anyway, we can:

  • See where we can use these in place of the Express-default bodyhashing approach. Personally I think we should turn that default off. It's even etagging error responses.
  • Use these etags in place of approaches that are prone to under-invalidation under concurrency (variants of max(some_timestamp)).
  • Use them where we currently can't have any ETag at all since the body-hashing approach can't work on responses where the headers are sent out while the body isn't known yet. example: submissions.csv.
  • In general scrutinize the way caching headers are currently set, as it currently results in errors also being cacheable. They're subject to revalidation, so while somewhat silly (likely unintended), they're not currently harmful, but for our future ideal front-end proxy caching setup, they result in cache flushes. See deliberations.

Metadata

Metadata

Assignees

Labels

backendRequires a change to the API serverperformancePerformance, benchmarking

Type

No type

Projects

Status

🕒 backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions