W
W
WebforSelf2022-02-01 10:01:26
webpack
WebforSelf, 2022-02-01 10:01:26

How to update webpack style cache?

The question of such a plan, changed scss in the project and built the project using yarn build. css on the server was updated assembled, but the cache remained in the browser, is it possible to update the versions of styles on the webpack side so that all users are updated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2022-02-01
@WebforSelf

you can use url on css of this kind
<link rel="stylesheet" href="/frontend.css?v=2">
when you need to forcefully reset styles, just replace the number
, but it is also advised to
use hash in the file name style.baedb042c16e1bf.css. I recommend using webpack to build.
Making a hash through a question mark is not recommended, there may be problems with caching proxies and CDNs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question