Caching issue

I'm currently very annoyed by some caching issue I'm facing on my local machine. I made a short video to show the issue. All I do here is refresh the page.

Anytime the white form is visible, it shows the old CSS. This is how I include the CSS into my site:

<link rel="stylesheet" href="/css/website.css?v={{ if environment == "local" }}{{ now format="hs" }}{{ else }}0312211{{ /if }}">

When local, append ?v=HOURSECOND to the file. When live, I use a date string like MONTHDAYYEARUPDATE. Even when I clear the caches (all of them), the old CSS is being loaded sometimes.

How can I avoid such behaviour?

>>>>>>> Unanswered <<<<<<<
1 Reply
1 Follower