After Vue is packaged, the file name is randomly generated, and the switching route is invalid when the user accesses it.

RT.
at first, the name of the packaged file was changed to prevent client-side caching, but now the problem arises. After repackaging and deployment, if the user is still on the current page, the routing operation cannot be switched unless the page is refreshed. Is there a good solution

wait online, it"s in a hurry

Mar.23,2021

ide/essentials/history-mode.html-sharpexample-server-configurations" rel=" nofollow noreferrer "> https://router.vuejs.org/guid.


do not change the name of your file, just append a timestamp to ensure that it can still be normal without cache


Don't delete the previous version of js every time you release, Old users can continue to access and refresh the new js that can be accessed after refreshing.

Menu