Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Image Handler cached on NextJS despite including specified headers #533

@nickreynolds

Description

@nickreynolds

Describe the bug

I am using Frog in a NextJS application along with an Image Handler to render a layout-intensive frame.

I've followed the instructions on this page: https://frog.fm/concepts/image-handler starting from the provided NextJS template from this repo.

However, caching is persisting even with the provided headers on the image response:

return c.res({
    image: (      
        ...
    ),
    headers: {
      "cache-control": "max-age=0",
    }
})

The only way I can reliably test changes is to change the name of the image endpoint, which is obviously not an ideal DevEx.

Link to Minimal Reproducible Example

https://github.com/nickreynolds/frog-next-caching

Steps To Reproduce

From the provided minimal repro example, run:

npm install
npm run dev

Then try changing any of the data. Notice that the rendered image does not update on a refersh to reflect your changes.

Frog Version

0.18.2

TypeScript Version

5.7.2

Check existing issues

Anything else?

No response

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