Skip to content

fetch cache behaviour unclear #47935

Open
@mmkal

Description

@mmkal

Affected URL(s)

https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch

Description of the problem

The docs say that global.fetch is a Browser-compatible implementation of the fetch() function, but it's unclear what that means with respect to caching.

Calling fetch('https://example.com') twice doesn't result in any caching, despite a cache-control response header existing. Similarly calling fetch('https://example.com', {cache: 'force-cache'}) makes two separate requests as well.

Is there a plan to implement caching, or a recommended way for end-users to provide caching? Is the cache property on RequestInit supposed to do something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.fetchIssues and PRs related to the Fetch API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions