How can I force clients to refresh JavaScript files?

后端 未结 26 2218
旧时难觅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:22

    In PHP:

    function latest_version($file_name){
        echo $file_name."?".filemtime($_SERVER['DOCUMENT_ROOT'] .$file_name);
    }
    

    In HTML:

    
    
                                     
                  
提交回复
热议问题