jeffreyvr / tailpress

TailPress is a minimal boilerplate theme for WordPress using Tailwind CSS.
https://tailpress.io
MIT License
1.22k stars 158 forks source link

npm run watch-sync requires to force browser cache to see changes #162

Closed pixeline closed 1 year ago

pixeline commented 1 year ago

Hi!

When developing the theme, I use npm run watch-sync . Browser reload when saving a watched file works fine but the changes are not visible until i force a hard browser cache refresh . image

I was wondering if there is a way to have it done automatically or to not have the browser cache interfere ?

jeffreyvr commented 1 year ago

Hi! This is not something I'm able to reproduce (tested Safari and Chrome). Should work like this:

https://user-images.githubusercontent.com/9550079/206429922-6eb0f7c7-8e23-49b0-bdcf-48e81c8d3238.mov

pixeline commented 1 year ago

In my case, it happens when i modify the css / js files, not the html produced by WP.

https://user-images.githubusercontent.com/393415/206454656-bf4c1efe-a3fa-4592-824b-a33a4112afb3.mov

charlie-george-1989 commented 1 year ago

Screenshot 2022-12-08 at 23 29 14

You could try disabling cache like this

pixeline commented 1 year ago

I was more looking for a cache busting fix (e.g. updating the css file url with a timestamp, from style.css?v=1234 to style.css?v=1235 ) but that will do for now, thank you!

jeffreyvr commented 1 year ago

Timestamp will be added if you set the environment type to 'development' (https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/).

pixeline commented 1 year ago

@jeffreyvr thank you very much, that did the trick!