A
A
Artem Menchenya2018-02-25 10:54:51
Laravel
Artem Menchenya, 2018-02-25 10:54:51

How to force the browser to update the js and css files on the Lararel site after they have been updated on the production server?

Good afternoon. Webpack has the ability to set the version of compiled css and js files (Laravel5) and everything works great on the local server. But when you upload the project files to the server, the css and js files are updated only after the browser history is reset (Ctrl+F5). Tell me how to solve this problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Talalaev, 2018-02-25
@Notimetosleep

You're fine, it's just cache.
For the simplest deployment (let's say stupidly git pull) use something like this .
Modify this script to suit your needs.
Well, and so, of course, during the deployment, you need to forcibly clear all caches, then the changes will be visible.

A
Alexander Aksentiev, 2018-02-25
@Sanasol

https://laravel.com/docs/5.6/mix#versioning-and-ca...

U
UksusoFF, 2018-02-25
@UksusoFF

In the place where css / js is included in the template, display the version of the application after.css?v={{ config('app.version') }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question