Skip to content

Emit RFC 9429-compliant rate limit headers #8192

@atkrad

Description

@atkrad

The problem I'm facing

Tyk currently sends rate limit information using the legacy X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. These use the old X- prefix convention and are not compliant with the now-published IETF standard for rate limit headers. As a client following the standard, I cannot rely on Tyk's current headers.

The solution I'd like

Tyk should emit the standardized headers defined in RFC 9429 ("RateLimit Header Fields for HTTP", IETF httpapi WG, August 2023):

RateLimit-Limit: 1000
RateLimit-Remaining: 42
RateLimit-Reset: 3600
RateLimit-Policy: 1000;w=86400

Key differences from the current implementation:

  • No X- prefix.
  • RateLimit-Reset is a delay in seconds (not a Unix timestamp).
  • RateLimit-Policy is a new field describing the quota window and policy.

For backward compatibility, the existing X-RateLimit-* headers could be kept alongside the new ones during a transition period, or made opt-in/opt-out via API definition configuration.

Alternatives I've considered

  • Keeping only the existing X-RateLimit-* headers maintains backward compatibility but leaves Tyk non-compliant with the published standard.
  • Emitting both sets of headers simultaneously is the safest migration path, as existing integrations continue to work while new clients can adopt the RFC 9429 headers.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions