Van Adrian Cabrera Van Adrian Cabrera - 2 years ago 90
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)?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download