Railway IaC manages service CDN edge caching
Introduced 2026-10-15 · score 0.94
HOW TO USE IT
When the environment config supports `cdn`, add the block to manage a service’s edge caching and reconcile it with the environment. Pull a cached service’s config to see the serialized block; defaults are omitted.
cdn:
enabled: true
defaultTtlSeconds: <seconds>
htmlCaching: <mode>
staleWhileRevalidate: <boolean>
purgeOnDeploy: <mode>WHY THIS HELPS
Manage a service’s edge caching settings through a Railway config file and reconcile them with the environment.
REQUIREMENTS AND LIMITATIONS
- Version: v5.69.0
- cdn.enabled: Enables caching; `false` is normalized away like removing the block.
- cdn.defaultTtlSeconds: Default edge TTL in seconds; default is `7200` and is omitted when serialized.
- cdn.htmlCaching: HTML caching mode; default is `"auto"` and is omitted when serialized.
- cdn.staleWhileRevalidate: Stale-while-revalidate setting; default is `true` and is omitted when serialized.
- cdn.purgeOnDeploy: Purge-on-deploy mode; default is `"html"` and is omitted when serialized.
- Prerequisite: The environment config must serialize `cdn`; until then, an authored block does not take effect.
- CDN settings are serialized only while caching is on.
- Only knobs that differ from the edge defaults are serialized; defaults are `defaultTtlSeconds: 7200`, `htmlCaching: "auto"`, `staleWhileRevalidate: true`, and `purgeOnDeploy: "html"`.
- The CDN update has `deployEffect: none`; settings live on the edge and do not reach the container.
- Until the environment config serializes `cdn`, an authored block does not take effect.
FIRST-PARTY EVIDENCE
Check the installed version and the source before using it. Entry JSON