Home > database >  deploy jquery or javascript front-end project
deploy jquery or javascript front-end project

Time:12-14

I use adminlte admin template for my admin panel project. adminlte is developed with jquery, javascript, and bootstrap. I developed a project with separate front-end and back-end layers, which means my front-end project is just jquery and javascript and backend is .net core. When I want to publish the front-end layer, I just copy files on the server. I want to know, is this the correct way?

One of the problems is that the browser caches javascript files and when I copy the new version on the server, browsers loads previous versions. How to solve this problem?

CodePudding user response:

I do know on firefox and chrome you can disable caching by going to the network tab on the developer panel and click the disable cache button firefox chrome

CodePudding user response:

Into your import, you can use param like ?=xxx and change this value when you have new version of this js

<script src="js/XXX.js?v=1">

next time if you want to update that

<script src="js/XXX.js?v=2">
  • Related