Why this matters
Reduces memory pressure and improves throughput on big tables.
Stream results (cursor/generator) or paginate instead of loading entire result sets into memory.
Reduces memory pressure and improves throughput on big tables.
Side-by-side examples engineers can pattern-match during review.
$rows = $pdo->query('SELECT * FROM logs')->fetchAll(); // huge$stmt = $pdo->query('SELECT * FROM logs');
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
// process row
}fetchAll()while($row=$stmt->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.