Cached CSS error? #3825
-
Hey! We keep running into a cache error immediately after deploying our docs to WordPress. The CSS and JS are renamed, and the HTML points to the new filenames, but because the browser is cached, it’s still pointing to the old filenames. You can reproduce this error by inspecting the doc site and removing main.120efc48.min.css We’ve tried adding cache-control headers, but that hasn’t worked. I know that cache-busting is not supported by mkdocs-material or mkdocs, but has anyone encountered this issue and successfully resolved it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If the browser points to the new filenames, it's actually impossible that the old files are used. I'm not sure I understand the problem, but it might be related to a delay in deploying the new assets. A scenario I could imagine: deploy new HTML, then deploy new assets – browser points to new assets, but new assets might have not been deployed or propagated to CDNs or whatever you use. All in all, this is not specific to Material for MkDocs but a general caching or deployment problem. Edit: ... or, it's the other way round – the old CSS files have been deleted and replaced, but your browser did not re-request the HTML file (or got 304 not modified due to misconfiguration), thus trying to request the old files while only the new are present. |
Beta Was this translation helpful? Give feedback.
If the browser points to the new filenames, it's actually impossible that the old files are used. I'm not sure I understand the problem, but it might be related to a delay in deploying the new assets. A scenario I could imagine: deploy new HTML, then deploy new assets – browser points to new assets, but new assets might have not been deployed or propagated to CDNs or whatever you use. All in all, this is not specific to Material for MkDocs but a general caching or deployment problem.
Edit: ... or, it's the other way round – the old CSS files have been deleted and replaced, but your browser did not re-request the HTML f…