Version the CSS and JS links with a content hash #34
Loading…
Reference in a new issue
No description provided.
Delete branch "cache-busting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The build appends a short content hash to the stylesheet and script links, e.g.
/styles.css?v=65f4446c, so a browser never serves a stale copy after a deploy. The server caches any non-HTML request carrying avquery for a year as immutable. Unversioned CSS and JS keep the one-day cache, and HTML stays no-cache.Tests cover both links carrying a hash and the immutable header only appearing on versioned URLs. Build,
node --testand html-validate pass.