sincecutoff.com
← all changes

railway cdn manages service CDN caching

Introduced 2026-06-20 · score 0.98

HOW TO USE IT

When managing CDN settings for a Railway service, use `railway cdn status`, `enable`, `disable`, `update`, or `purge`; choose the service with selectors as needed. Enabling caching requires an applied public domain.

railway cdn status --service <SERVICE>
railway cdn update --html-caching force --default-ttl 4h --service <SERVICE>
railway cdn purge html --service <SERVICE> --json

WHY THIS HELPS

Manage CDN caching for a selected Railway service while maintaining or reviewing its deployment configuration.

REQUIREMENTS AND LIMITATIONS

  • Version: v5.19.0
  • --service, -s <SERVICE>: Service name or ID; defaults to the linked service.
  • --environment, -e <ENVIRONMENT>: Environment to use; defaults to the linked environment.
  • --project, -p <PROJECT_ID>: Project ID to use; defaults to the linked project.
  • --json: Output in JSON format.
  • --html-caching <MODE>: Set HTML caching mode; documented enum values are not_found (source code page defines the enum, but values not retrieved). At least one update setting is required.
  • --default-ttl <TTL>: Set default TTL; accepted values: 30m, 1h, 2h, 4h, 12h, 1d, or matching seconds. At least one update setting is required.
  • --swr / --no-swr: Honor or ignore stale-while-revalidate Cache-Control directives; mutually exclusive. At least one update setting is required.
  • --purge-on-deploy <POLICY>: Set cache purge policy after successful deploys; allowed values not retrieved. At least one update setting is required.
  • <html|all> (required): Purge scope. Purges apply to the whole service; per-URL purge is unsupported.
  • Prerequisite: CDN caching requires an applied public domain. The CLI docs say to add a domain with `railway domain` first.
  • `railway cdn enable` requires an applied public domain.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card