Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

813
Visualizações
Vue files on Laravel does not reflect changes after pulling changes from repository on production server

im workin with LARAVEL and vue. i'have launched a project on digital ocean using ubuntun and nginx. Since the launch i'have add more features. Today i pulled those change on the production server, but they do not appear on the browser..

Using nano i'have chechked all the files, and yes, the files have changed but they do not reflect on the browser.

I'have used npm run dev, npm run watch php artisan config:cache, php artisan cache:clear but yet it doesnt seems to work any idea ?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Before you push your updated Vue files you need to run npm run prod to prepare your assets as production ready.

Laravel uses mix to compile assets: https://laravel.com/docs/8.x/mix

Now you have your freshly compiled assets in your public/ directory, therefore you can pull to digitalocean machine. But now the browser might still be using cached asset (if name stays same, browser doesn't fetch same asset again for a while)

So, Mix Versioning comes to help: https://laravel.com/docs/8.x/mix#versioning-and-cache-busting

In your webmack.mix.js file you need to add .version() at the end of mix piping. End result will be something like this;

mix.js('resources/js/app.js', 'public/js')
    .version();

As you want to use versioning, now you need to resolve asset urls with mix(...) instead of asset(...) in your blade files;

<script src="{{ mix('/js/app.js') }}"></script>

Now whenever you compile your assets, mix will assign them new version numbers and will at them to end of assets' urls in your blade. Browser will understand there is a update in file (because of a different version number) and will fetch updated asset.

over 4 years ago · Santiago Trujillo Relatório

0

Did you clear your browser's cache?

If you are working with Vue and/or Sass and therefore your files are changing from time to time, I suggest you to use mix() instead of asset() for cache busting. Otherwise all of your users will have to delete their cache (this is obv. not a good approach)

https://laravel.com/docs/8.x/mix#versioning-and-cache-busting

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda