How to prevent CSS caching on a web page?

后端 未结 9 1860
你的背包
你的背包 2020-12-14 17:42

I am learning to develop xhtml, css web pages. Often I am doing changes in CSS but it do not reflect on page because of browser cacheing and if I manually clear cahceing it

9条回答
  •  别那么骄傲
    2020-12-14 17:59

    This can be done through a .htaccess file. Place this code in a file named .htaccess at the root of your website:

    
    FileETag None
    
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
    
    
    

提交回复
热议问题