htaccess - How to force the client's browser to clear the cache?

前端 未结 12 1403
情歌与酒
情歌与酒 2020-12-07 14:23

For my site I have the following htaccess rules:

# BEGIN Gzip

AddOutputFilterByType DEFLATE text/text text/html text/plain tex         


        
12条回答
  •  旧巷少年郎
    2020-12-07 14:54

    You can tell the browser never cache your site by pasting following code in the header

    
    
    
    

    And to prevent js, css cache, you could use tool to minify and obfuscate the scripts which should generate a random file name every time. That would force the browser to reload them from server too.

    Hopefully, that helps.

提交回复
热议问题