Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Base Cache-Control on the backend's actual caching, not copy-paste
When adding cache headers to an endpoint, verify how long the upstream/backend caches that resource (or ask the PM) instead of copying values from an unrelated endpoint.
Bad example
| 1 | res.setHeader('Cache-Control', COPIED_FROM_OTHER_ENDPOINT); |
Explanation (EN)
Copying an unrelated endpoint's headers can exceed the actual data freshness or privacy contract.
Objašnjenje (HR)
Good example
| 1 | // Verified upstream caches this for 5 minutes |
| 2 | res.setHeader('Cache-Control', 'public, max-age=300'); |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Choose downstream freshness from the end-to-end staleness allowance, upstream object age/TTL and whether the representation is safe for shared caching.
Exceptions / Tradeoffs (EN)
An upstream five-minute TTL does not automatically justify another fresh five minutes downstream. Account for Age and propagation, authorization scope and revalidation behavior.