Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: disable cache in dev-mode #21574

Merged
merged 2 commits into from
Mar 15, 2023
Merged

Conversation

ndelangen
Copy link
Member

Closes #21443

What I did

I just added a no-cache control header on every request coming from the storybook dev-server

How to test

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template react-vite/default-ts
  2. Open Storybook in your browser
  3. check the request in the network tab, they should all show no-cache headers

@ndelangen ndelangen changed the title disable cache in dev-mode Bug: disable cache in dev-mode Mar 13, 2023
@kylegach kylegach requested review from yannbf and chakAs3 March 13, 2023 14:17
@ndelangen
Copy link
Member Author

@shilman let's discuss after storybook day?

@chakAs3
Copy link
Contributor

chakAs3 commented Mar 14, 2023

i was really waiting for this. i was manually do it disabling the cache or opening incognito, but still in incognito i don't have vue extension.

so thanks @ndelangen

Copy link
Contributor

@chakAs3 chakAs3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will go ahead i merge this PR, these simple lines of code could saved 2 days of my life i was burning

@ndelangen ndelangen merged commit f229785 into next Mar 15, 2023
@ndelangen ndelangen deleted the norbert/fix-21443-no-caching-in-decmode branch March 15, 2023 10:58
@DarthVitalus
Copy link

Hi, guys! Could you please help me out here. Is there a way to change this header by config? Maybe webpackFinal? i've tried to make

/* .storybook/main.js */
module.exports = {
  webpackFinal: (config) => ({
    ...config, 
    devServer: { 
      proxy: { 
        '/static': { 
          headers: { 
            'Cache-Control': 'no-cache' 
          }
        }
      }
    }
  })
};

and still got no-store. So my fonts are loading again and again on every story i visit (and keep, you know, swapping). In develop build, production is good. I'm trying to understand, either i'm doing something wrong, or this behavior should be somewhat more configurable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Manager.js caching prevents changes in theming
3 participants