Chrome WON'T clear cache… ctrl + F5 doesn't seem to work either

后端 未结 16 1297
南旧
南旧 2020-12-14 00:05

I\'m working on a web project but I have this really annoying issue with my browser, Google Chrome... Every time I make changes on my website, my browser won\'t refresh and

16条回答
  •  一个人的身影
    2020-12-14 00:16

    For testing and developing purpose only, you can make a use of the .htaccess file inside your developing root server, it will help you control the caching policy of the browser so you will able to work in non-caching environment.

    From Wikipedia (.htaccess):

    .htaccess files allow a server to control caching by web browsers and proxies to speed up websites

    The mod_expires tell the browser that the file is expire so it will go and fetch it again after 1 minute (you can even set it for 0 seconds - the file immediately expires)

     
      ExpiresActive On
      ExpiresDefault "access plus 1 minutes"
      ExpiresByType text/javascript "access plus 1 minutes"
      ExpiresByType text/html "access plus 1 minutes"
      ExpiresByType text/css "access plus 1 minutes"
      ExpiresByType image/gif "access plus 1 minutes"
      ExpiresByType image/png "access plus 1 minutes"
      ExpiresByType image/jpeg "access plus 1 minutes"
    
    

    see additional answer

提交回复
热议问题