Skip to content

Caching issue with fetch response: Incorrect behavior observed #8752

Closed
@alejogschwind

Description

@alejogschwind

Describe the bug

We ran into this issue while we were trying to do two similar GET requests to our API but with different headers. It seems that the caching system it's using only the URL and the body to create the key. Could you consider adding headers, too? Thanks

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-igyc9t?file=src%2Froutes%2F%2Bpage.js,src%2Froutes%2F%2Bpage.svelte&terminal=dev

You need to download the project to don't run into a CORS issue with the API.

Logs

No response

System Info

System:
    OS: macOS 12.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 5.28 GB / 16.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.119
    Safari: 15.6
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0 => 1.0.2 
    @sveltejs/kit: ^1.0.0 => 1.3.1 
    svelte: ^3.54.0 => 3.55.1 
    vite: ^4.0.0 => 4.0.4

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions