feat: Add X-IPFS-Root-CID header for faster cache invalidation#8617
feat: Add X-IPFS-Root-CID header for faster cache invalidation#8617mathew-cf wants to merge 1 commit into
Conversation
|
ipfs-webui test is flaky. amending and pushing |
|
tests still flaky. amending and pushing again |
|
Note: If you're just caching, use the etag. It's the CID when downloading a file, and the CID plus a dir-index hash when indexing a directory. (otherwise, it does seem reasonable to say "here's the CID of the thing I just resolved, but I'd just call it |
|
Basically the idea here is that I can use (mostly) DNS to resolve to a root CID at the edge. I can quickly cache and serve new data if I know whether my data currently in cache corresponds to the DNS record. The resolved root CID is different from the CIDs of the files in the directory (i.e. the CID in the etag). I named the header |
|
This wouldn't support IPFS subpaths. Needs some more thought |
|
I understand the desire here is to have resolved IPNS root CID in the response?
|
|
@mathew-cf check #8720 |
If content resolution is performed separately from a go-ipfs node via DNS and/or IPNS, then the root CID can be used to check if a cached response is fresh or stale for a given path.
This allows quick cache invalidation once a change to a DNSLink record is propagated.