A Symfony bundle that adds rate limiting to controllers and actions using PHP attributes.
NoxlogicRateLimitBundle is a Symfony bundle that enables rate limiting for controllers and actions via PHP attributes. It helps developers control how often endpoints can be accessed, preventing abuse and managing API traffic efficiently. The bundle is particularly useful for securing APIs by limiting requests per user, IP, or other criteria.
Symfony developers building APIs or web applications that need to enforce request limits to prevent abuse or manage resource usage. It's also suitable for teams requiring customizable rate limiting strategies beyond basic IP blocking.
Developers choose this bundle for its simplicity and flexibility—it integrates seamlessly with Symfony using attributes, supports multiple storage backends, and allows custom key generation for advanced rate limiting scenarios without heavy configuration.
Add rate limits to your controllers / actions easily through annotations
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Applying rate limits is as simple as adding #[RateLimit()] attributes to controllers or methods, reducing configuration overhead and keeping limits close to the code.
Supports Redis, Memcached, and Doctrine cache, allowing teams to choose a scalable solution based on their infrastructure needs, as detailed in the installation section.
Through event listeners, developers can implement advanced strategies like IP-based or user-specific limiting, with examples provided in the README for creating custom key generators.
Integrates rate limit headers (X-RateLimit-Limit, etc.) into responses by default, helping API clients manage their request usage effectively.
By default, the bundle does not rate limit by IP; implementing this requires creating a custom key generator, adding complexity for a common security use case as noted in the README.
Using Redis or Memcached necessitates installing additional bundles like SncRedisBundle, which can complicate setup and increase maintenance beyond core Symfony components.
While attributes are convenient, they lack the dynamic flexibility of YAML or database-driven configurations, making runtime changes harder without code modifications.