potion icon indicating copy to clipboard operation
potion copied to clipboard

Use last_modified / if_modified_since conditional headers

Open datashaman opened this issue 10 years ago • 1 comments

Emit a last_modified header linked to a property on the resource (and hence to a db column in the back-end).

Then there's no need to manage a cache in your client app. Any browser (and some client libraries) will cache everything correctly for you.

datashaman avatar Oct 10 '15 09:10 datashaman

An ETag would be more reliable, given that APIs might have user-based permissions leading to different results regardless of modification date. This could be configured on a per-resource basis though.

lyschoening avatar Oct 11 '15 13:10 lyschoening