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

docs: document bug in safari that caches css and prevents hmr #261

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

powersurge360
Copy link
Contributor

Discussed in an issue opened the other day.

Description 📖

Safari does not respect the combination of ETag and Cache-Control: no-cache headers without the use of a cache-busting query string. The vite_stylesheet_tag helper does not have this cache-busting query string but if you import the CSS directly into the JS, when it gets split out it works.

Background 📜

Bug in Safari

The Fix 🔨

We are documenting the behavior to help folks who may get stumped by it. In the issue, another option was linked in the comments as a workaround but that option didn't appear in my version of Safari and I wasn't able to work out how to disable cache. The only other option I've found so far is to manually empty the cache between stylesheet changes which is not a great dev experience.

Screenshots 📷

Not relevant to this change, just light documentation adjustments.

@powersurge360
Copy link
Contributor Author

I stuck it in network because it made the most sense to me of the existing headers. Let me know if you'd like that put somewhere else or want more background in the description of the issue in the markdown file.

@ElMassimo
Copy link
Owner

Thanks Kevin! I'll make some light edits after merging, but this looks great!

@ElMassimo ElMassimo merged commit 522391c into ElMassimo:main Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants