Google chrome css doesn't update unless clear cache

后端 未结 8 1829
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 23:48

I\'m trying to work in my local server but I have to clear my cache every time if I want to see changes on the css rules.

There is any way to control Google Chrome c

相关标签:
8条回答
  • 2020-12-13 00:18
    1. Open DevTools
    2. Open Settings (bottom right or use F1 shortcut)
    3. Check Disable cache (while DevTools is open)

    https://developers.google.com/chrome-developer-tools/docs/settings#general

    0 讨论(0)
  • 2020-12-13 00:18

    Following this solution here helped me reloading the css : https://wpreset.com/force-reload-cached-css/

    Instead of requesting the file doing the following :

    <link rel="stylesheet" href="~/css/variabledocument.css" type="text/css" />
    

    Request id by adding a parameter (the name of the parameter doesn't matter) at the end of the file :

    <link rel="stylesheet" href="~/css/variabledocument.css?refreshcss=1" type="text/css" />
    

    This will request the new css file. Whenever you make a change to your css file, you just have to change either the parameter name, value or both and the server will request it again.

    This is very useful when you have no control over the browsers of your clients and it requests no action on their part.

    0 讨论(0)
  • 2020-12-13 00:21

    More tools > Developer Tools
    Then right click the refresh button on the browser.
    You will get three options. Select "Empty Cache and Hard Reload".

    This will only impact the active tab.

    0 讨论(0)
  • 2020-12-13 00:29

    To Control Google Chrome Cache you can do following steps:

    1. Disable the cache (while DevTools is open)
    2. Close the Chrome Browser
    3. Clear the Cache with a cleaner software (such as CC Cleaner)
    4. Open Chrome browser
    0 讨论(0)
  • 2020-12-13 00:31

    You can do any of the following options:-

    1. Install a Chrome Extension like Clear Cache to clear cache by clicking on icon.
    2. Use Incognito Mode and browser your website in incognito mode. Incognito mode won't disable cache clearly. Disabling cache completely may slow down your browsing experience.
    3. Use chrome's features like Hard Reload (Clear cache and hard reload). Read this stackoverflow post
    4. As @Vitaly mentioned, Use Developer Tool settings to disable cache completely.

    Choose what fits you :)

    0 讨论(0)
  • 2020-12-13 00:34

    CTRL+F5 : to refresh the page by clearing GG chrome cache.

    0 讨论(0)
提交回复
热议问题