notion-api-worker icon indicating copy to clipboard operation
notion-api-worker copied to clipboard

Proposal: Add default cache-control

Open transitive-bullshit opened this issue 5 years ago • 1 comments

cache.put(request, response) uses the response's cache-control header to determine the object's TTL (and other standard headers).

Currently, we're passing responses with no cache-control which isn't really well-specified by Cloudflare as to what this actually means.

Experimentally, it appears that CF caches these objects for ~10 seconds, but we should really override this with a default value.

Note that for Notion2Site, I'm passing pragma: no-cache to disable caching within the worker because Vercel's SWR edge caching is all that's needed. Any additional caching of the page data just introduces additional lag before updates are reflected to their edge cache.

transitive-bullshit avatar Jul 21 '20 13:07 transitive-bullshit

Friend

Syntyche3456 avatar Feb 26 '22 03:02 Syntyche3456