Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ActionController::RateLimiting to use AS::Cache #50781

Merged
merged 2 commits into from Jan 17, 2024

Commits on Jan 17, 2024

  1. Ensure all Cache store have consistent TTL behavior on increment

    Make sure they all increment the counter but don't update the TTL.
    byroot committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    b54a287 View commit details
    Browse the repository at this point in the history
  2. Refactor ActionController::RateLimiting to use AS::Cache

    Given that the limiter implementation provided by Kredis is a simple
    increment with a limit, all `ActiveSupport::Cache` already provide that
    same capability, with a wide range of backing stores, and not just Redis.
    
    This even allow to use SolidCache has a backend if you so desire.
    
    If we feel particularly fancy, we could also accept a more generic
    limiter interface to better allow users to swap the implementation
    for better algorithms such as leaky-bucket etc.
    byroot committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    d839ddb View commit details
    Browse the repository at this point in the history