how to clear my clients cache next time they log in

后端 未结 6 1827
萌比男神i
萌比男神i 2021-01-11 18:27

I have an application running on hostgator. When I make changes to the js files my users don\'t see the changes until they clear their cache. Is this the only option to pu

6条回答
  •  梦谈多话
    2021-01-11 18:50

    The trick I use to avoid this issue is to modify the url of the updated script. This will force the client to download the script again as the ressource name is different.

    Easiest way to do it : use a version number at the end of the url js/my-script.js?v=1.0.

    Better way to do it (100% supported for all navigators): change the file name itself js/my-script.v1.0.js.

提交回复
热议问题