Describe the bug
By default media assets are handle with the file-loader. They are correctly hashed, but not served with a Cache-Control header. If you use Storybook as a live preview while developing a component this will often trigger multiple requests to these assets even though they weren't changed. (E.g. this is the case with styled-components which trigger multiple requests for fonts, for example. Due to the way this triggers re-rendering of the fonts layouts can "jump" around.)
To Reproduce
Steps to reproduce the behavior:
304 Not Modified for assets.Expected behavior
200 OK (from memory cache) for assets.Code snippets
It would be nice if hashed assets would be served with the HTTP Response header Cache-Control: public, max-age=31536000 during development.
System:
System:
OS: macOS Mojave 10.14.6
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.17.3 - ~/.yarn/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Browsers:
Chrome: 77.0.3865.90
Safari: 13.0.1
npmPackages:
@storybook/addon-a11y: ^5.2.1 => 5.2.1
@storybook/addon-backgrounds: ^5.2.1 => 5.2.1
@storybook/addon-docs: ^5.2.1 => 5.2.1
@storybook/react: ^5.2.1 => 5.2.1
@storybook/source-loader: ^5.2.1 => 5.2.1
@storybook/theming: ^5.2.1 => 5.2.1
By the way... $ npx -p @storybook/cli@next sb info is super nice for reports. Good that it is mentioned in the issue template. 馃憤
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
I have the feeling the stale bot is a little bit too fast 馃
Stale bot is annoying, but it runs after three weeks and is a good kick in the pants. If somebody wants to sign up for this, they are welcome to, and we can mark it as in progress which will make the stale bot go away. If not, I think we have no choice but to flush the issues and resurrect them when somebody is ready to take them on. We're already at 441 open issues even with this stale policy...
Hi there! I'm a first time contributor and would love to take a stab at this if possible.
@jay-bis Awesome, please do! And feel free to post here or jump on our Discord if you need help contributing: https://discordapp.com/invite/UUt2PJb
Hi @jay-bis, are you still working on this?
Myself and @christopherhafke are interested in taking a stab, if you're no longer working on it. We're first-time contributors as well :)
Hey @jay-bis! Just letting you know that @christopherhafke and myself are going to take a stab at this issue - if you are still working on it, the two of us are on the Storybook discord at eash#0001 and chafke#9253, or you can let us know here if you still are.
@donaldpipowitch the above PR has just been merged into next with this feature added, so hopefully this closes the issue for you!
Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.36 containing PR #10390 that references this issue. Upgrade today to try it out!
You can find this prerelease on the @next NPM tag.
Closing this issue. Please re-open if you think there's still more to do.
Thank you so much 鉂わ笍鉂わ笍
Most helpful comment
Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.36 containing PR #10390 that references this issue. Upgrade today to try it out!
You can find this prerelease on the
@nextNPM tag.Closing this issue. Please re-open if you think there's still more to do.