Skip to content

fix: honor cache directives for streaming requests #154

Description

@peterpme

Problem

nitroFetch(..., { cache: "no-store" }) adds Cache-Control: no-store on the standard request path, but the stream: true path currently ignores RequestInit.cache. On iOS, streaming requests use a disk-backed URLCache, so a caller can explicitly request no-store and still have the streamed response remain eligible for persistence.

This is especially important for authenticated responses containing tokens or other sensitive material.

Proposed fix

Reuse the existing cache-directive header mapping for both standard and streaming requests, with focused fetch-compliance coverage. This preserves the existing 32 MiB memory / 100 MiB disk cache for default requests; it does not disable caching globally.

I can send a small PR for this.

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