TagHelper under .NET Core MVC

.NET web developers in the development process, must have stepped on a pit, obviously modify the js file, but deploy to the production environment, customer feedback, said: "It is being given ah." . Then look ignorant forced to file server point of view, it has been updated. Experienced coder might think, and certainly the client browser cache out of the ghost.

At this point the customer will tell, please Crtl + F5 to refresh, then the customer will say: "What is Ctrl." .

Our usual approach is quoted on the js file, manually change the version number such as jquery.js? v = 20200222 to resolve. But if you forget to change, and trouble.

In the Microsoft .NET core of Razor pages added (advanced properties of some html controls) TagHelper, just need to add some properties in the original references can be solved. FIG follows: Adding asp-append-version attribute Script control and to 'true'.

 

 

 After the run, then F12 will see in the browser as follows:

 

 After the server will automatically add a suffix to the static resources to solve the problem the client cache. Intimate ~

Microsoft on many controls are added tagHelper advanced properties to solve the problem before the release of a wide range of small, together find it ~

Guess you like

Origin www.cnblogs.com/psycheeeeeblog/p/12346338.html