How can I force clients to refresh JavaScript files?

后端 未结 26 2216
旧时难觅i
旧时难觅i 2020-11-22 03:40

We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slo

26条回答
  •  粉色の甜心
    2020-11-22 04:17

    One simple way. Edit htaccess

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} \.(jpe?g|bmp|png|gif|css|js|mp3|ogg)$ [NC]
    RewriteCond %{QUERY_STRING} !^(.+?&v33|)v=33[^&]*(?:&(.*)|)$ [NC]
    RewriteRule ^ %{REQUEST_URI}?v=33 [R=301,L]
    

提交回复
热议问题