Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP1universalStack: node
cachinghttpapicorrectness
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.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | res.setHeader('Cache-Control', COPIED_FROM_OTHER_ENDPOINT); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // Verified upstream caches this for 5 minutes |
| 2 | res.setHeader('Cache-Control', 'public, max-age=300'); |
Explanation (EN)
Objašnjenje (HR)