-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Bust the assets cache on modification. #309
Conversation
I like this, annoying to always have dev tools open and the cache probably trips up beginners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this will work when developing locally, assets will still be cached by the browser when the user deploys the app. The use case I'm imagining is:
- Developer deploys their app
- Person A visits their app
- Developer changes CSS, deploys again
- Person A visits again - the CSS is cached from when they visited the app before the previous deploy.
The developer won't see an issue because they got the new version when they were developing, so they might not even know that their visitors will have an issue.
So, I think we should append a time modified query string or some other solution
090e0fd
to
35a4bb0
Compare
@chriddyp I changed this PR to use time modified query string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for updating this! Once this is released, could you update https://github.com/plotly/dash-docs/blob/master/tutorial/external_css_and_js.py#L160-L163?
@T4rk1n - Could we get this one merged and released? |
@chriddyp |
OK. Why? It seems to complicate things to have two different ways that caches are invalidated in local vs deployed. Also, we don't have the config abstraction around local vs production yet. |
That is also my feeling, I'll merge & release. |
35a4bb0
to
67f8601
Compare
Append time modified as query string to assets urls to trick the cache to refresh the file.
cc @plotly/dash
Resolves #303