Search code examples
cssdjangowebpackgoogle-chrome-devtoolsbrowser-cache

hard reload loads new css but f5 load the older version (even after the hard reload)


I have wagtail project, in this project I compile scss with webpack to the static folder in my project. When i have devtools open (and i checked the no cache checkbox) and then reload the page, the css is loaded. When i hard reload (clear cache etc) the new updated css is applied. If after this i press f5 again the previous older version is loaded.

How and why is this happening? This is the first time i've encountered this problem.

maybe it doesn't override the cache with the new css?

I am running chrome version: 98.0.4758.109


Solution

  • Eventually fixed this with adding hashes in the build files with webpack. So the filename wouldbe eg: main.2738547.css