Asset hashing uses content hash in filename
Why it matters
An asset named app.js with no content hash cannot be safely cached for more than a few minutes — the browser has no way to know whether the file changed since the last visit. Setting a long max-age on an unhashed asset means users receive stale code after a deploy; setting a short max-age means the asset is re-downloaded on every visit. Content hashing is the mechanism that makes aggressive 1-year caching safe: the filename itself is the cache key. ISO 25010:2011 time-behaviour links asset hashing to time-behaviour because it determines whether repeat visitors pay full download cost on every page load.
Severity rationale
Info because missing content hashes force a tradeoff between stale delivery and cache efficiency — the impact is either wasted bandwidth or stale assets, both of which degrade experience but do not cause functional failures.
Remediation
In Next.js and Vite, content hashing is automatic in production mode — verify it is not disabled in next.config.js. For custom webpack setups, configure [contenthash] in the output filename pattern.
// webpack.config.js — content hash in production
module.exports = {
output: {
filename: process.env.NODE_ENV === 'production'
? '[name].[contenthash:8].js'
: '[name].js',
},
}
Verify hashes are generated by inspecting .next/static/chunks/ — filenames should contain an 8-character hex string that changes when the file content changes.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Performance Deep Dive Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · time-behaviour — Time Behaviour (performance efficiency)
Taxons
History
- 2026-04-18·v1.0.0·Initial import from performance-deep-dive·automated