[ci skip] [docs] make increment requirement explicit #50909
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
As of December, ActionController::Metal::RateLimiting provides rate limiting through the
increment
method of any cache store. RateLimiting relies on a feature of the underlying store. This feature needs to be documented, so that it remains supported, and so alternative stores know to support it.This PR has been created to document this behavior.
Detail
The feature is that
increment
, when passedexpires_in
, will set expiration time when the key is first created, and ignore that option if the key already exists.That functionality is already tested here, in the
CacheIncrementDecrementBehavior
test module.This Pull Request changes the documentation of
ActiveSupport::Cache::Store.increment
to reflect a now-required feature of existing stores.