From the course: Building Laravel and Vue.js 2 Web Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Cache busting and Browsersync

Cache busting and Browsersync

From the course: Building Laravel and Vue.js 2 Web Apps

Start my 1-month free trial

Cache busting and Browsersync

- [Instructor] We'll continue to explore Laravel Mix in this video, while we talk about cache busting, and browser sync. If I continue to edit this file, and then refresh the page, I might not see any changes because the browser will often get the App.js file from its cache. One way to avoid having that be loaded from the cache when there are new changes, is to add a query string with a unique hash to the file name. We can accomplish this by first just adding a call to the version method in our mix file. In our lay-out file, remember I said that asset just creates an absolute URL, so if we also want to append the unique hash we'll have to change asset to mix here. And lets do that for App.js and App.css. We'll need to stop the running watch process with Control + C and then restart it. And now when I refresh, I see my original change, and if you do View Source you can also see that unique hash appended as a query string. Let's test a change to our .sas file now. So in Resources, sas…

Contents