Why this matters
Prevents UI jank and rate-limit issues.
Apply debounce/throttle to handlers that trigger network calls or heavy computation on rapid input.
Prevents UI jank and rate-limit issues.
Side-by-side examples engineers can pattern-match during review.
input.oninput = e => search(e.target.value);const debounce=(fn,ms)=>{let t;return(...a)=>{clearTimeout(t);t=setTimeout(()=>fn(...a),ms)}}; input.oninput=debounce(e=>search(e.target.value),200);oninput => fetch()oninput => debounce(fetch)From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.