Share cache response across checks? #530
Unanswered
gsaks123
asked this question in
Questions (Q&A)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Apologies if there is an easy way to accomplish this or it's redundant; I tried to comb through both the open and closed issues to see if there was anything similar.
In order to reduce the number of requests I make to my Redis cache, I am trying to see if I can share the response from one cache call across multiple Rack Attack checks (specifically, safelist, blocklist, and track).
My current process flow is roughly as follows:
The above process flow entails 3 cache store requests for the same value. I was hoping to get this down to a single request in my RackAttack initializer:
request.env['rack.attack.matched']Is there an existing solution the gem supports, e.g. the equivalent of setting an instance variable in a method at the top of the initializer? Thanks in advance!!
Beta Was this translation helpful? Give feedback.
All reactions