how to clear my clients cache next time they log in

后端 未结 6 1743
萌比男神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:53

    One trick to get around this is to append a query string with some kind of version or timestamp to your link Javascript calls. For example:

    
    

    This example is simple, but proves the point. Basically this tells the browser to load the file if it doesn't recognize the full path. Anytime you change your javascript file and want your users to pickup the latest version, just update that timestamp or value after the question mark (query string).

提交回复
热议问题