After the react project is released, users need to refresh the browser manually in order to run normally.

has MD5 value, and the packaged hash value is also different each time js changes the code, but the user must refresh the page cache to use

normally.

index.html is cached
the cached index.html refers to the old js and css resources, which are also cached by the browser, so the last visited page is loaded.
modify the nginx configuration
location / {

index index.html;
if ($uri ~* "html$") {
    add_header Cache-Control "no-cache, no-store, max-age=0, must-revalidate";
}

}


check whether index.html has set cache in Nginx
check whether the project's vendor.js common.js has hash


? It feels normal.

Menu