Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jake2315's avatar

Cache busting on Chrome

So for some reason, unlike Chrome, my Internet Explorer receives the compiled SASS and Vue on refreshing the page.

When I run my site on Chrome, all elements that I configured with SASS or Vue won't display.

Why is that and how do I fix it?

I've had the same problem on Laravel 5.3, but I ended up fixing it. Now with elixer being gone, I have no clue on how to do it with Mix.

PS: I'm sorry if this description of my problem is a bit hazy, but it comes down to the fact that I have a problem with cache busting on Chrome.

0 likes
2 replies
Jafo232a's avatar

I had this same issue, and cache-busting doesn't fix it. I believe there are some aggressive caching settings in Chrome. Here is how I resolved it on my end, at least with Javascript. I assume you can do the same with the css files:

Create a rewrite rule in .htaccess:

RewriteRule ^cache-bust-(.*)/js/(.*)$ /js/ [L]

Then wherever you include your js calls, do something like:

<script src="/cache-bust-{{ \Cache::remember('cache-bust_' . md5(mix('/js/manifest.js')), 60, function () { return md5(mix('/js/manifest.js')); }) }}{{ mix('/js/manifest.js') }}"></script>
<script src="/cache-bust-{{ \Cache::remember('cache-bust_' . md5(mix('/js/vendor.js')), 60, function () { return md5(mix('/js/vendor.js')); }) }}{{ mix('/js/vendor.js') }}"></script>
<script src="/cache-bust-{{ \Cache::remember('cache-bust_' . md5(mix('/js/app.js')), 60, function () { return md5(mix('/js/app.js')); }) }}{{ mix('/js/app.js') }}"></script>

That should change the file path each time you run npm watch or npm production.

I hope this helps.

Please or to participate in this conversation.