Why this matters
Reduces CPU and GC pressure in hot paths.
Do not recompute expensive values inside loops; compute once and reuse.
Reduces CPU and GC pressure in hot paths.
Side-by-side examples engineers can pattern-match during review.
items.each { |i| heavy = JSON.parse(File.read(cfg)); use(heavy, i) }heavy = JSON.parse(File.read(cfg))
items.each { |i| use(heavy, i) }Regexp.new(pattern) inside eachre = Regexp.new(pattern); items.each { re.match(_1) }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.