Van Adrian Cabrera Van Adrian Cabrera - 1 year ago 57
PHP Question

What is the importance of using the .version in elixir (Laravel)?

I'm studying laravel framework and I encountered the elixir function that's using


elixir(function(mix) {

I want to know if what's the importance of this function (in what situation)?


The importance and use case of using version with Laravel Elixir is already pointed out in the documentation

Many developers suffix their compiled assets with a timestamp or unique token to force browsers to load the fresh assets instead of serving stale copies of the code.

Sometimes you run into situations where browsers do not fetch the new content/version of a CSS/JS file. With appending a unique stamp to the CSS/JS file name the browsers are aware of the new file (new file name) and load the new asset