0

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?

2 Answers 2

1

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">
Sign up to request clarification or add additional context in comments.

2 Comments

maybe even smarter is to have version stored in a file, and change it only there, then use variable in src
@den, exactly, I used the same method, but the browser doesn't understand this, sometimes. I want to know if there is a way to publish all the files together in a package or not, like deploy a vue-js or react project
0

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

2 Comments

yes, this work will be done with CTRL + F5 on the browser, but this problem was solved just for me. users should not be involved with this problem
@mohsenahmadi who are you using to host your services, some will cache but have the option to turn it off temporarily for development mode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.