Skip to content

Improve caching behavior around Chrome disk cache #342

@kylebarron

Description

@kylebarron

According to docs about Chrome HTTP caching behavior: https://www.chromium.org/developers/design-documents/network-stack/http-cache/

The cache implements a single writer - multiple reader lock so that only one network request for the same resource is in flight at any given time.

So it seems that other requests for the same file will be handled serially by Chrome, which is very bad.

I think ideally we want

fetch(url, {
  headers: { Range: "bytes=..." },
  cache: "no-store",
});

which chatgpt says

  • Bypasses browser cache
  • Avoids lock
  • Keeps server/CDN caching intact

But to do that we need access to more fetch properties than just headers, which is what https://github.com/blacha/chunkd/blob/9b7e1480d2435d06b87a0f716e3d35ab94111f80/packages/source-http/src/index.ts#L35-L38 currently exposes.

blacha/cogeotiff#1446 should hopefully make it easier to build source interfaces

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions