CSS file not refreshing in browser

前端 未结 15 1314
旧时难觅i
旧时难觅i 2020-11-29 04:55

When I make any changes to my CSS file, the changes are not reflected in the browser. How can I fix this?

15条回答
  •  心在旅途
    2020-11-29 05:39

    The reason this occurs is because the file is stored in the "cache" of the browser – so there is no need for the browser to request the sheet again. This occurs for most files that your HTML links to – whether they're CDNs or on your server, for example, a stylesheet. A hard refresh will reload the page and send new GET requests to the server (and to external b if needed).

    You can also empty the caches in most browsers with the following keyboard shortcuts.

    Safari: Cmd+Alt+e

    Chrome and Edge: Shift+Cmd+Delete (Mac) and Ctrl+Shift+Del (Windows)

提交回复
热议问题