You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
I'm trying to figure out if there is a better way to load client policies w/o loading all of them on startup. I can load all via IThrottlePolicyProvider, but I think as the number of clients grows it would be bit on the heavy side.
So far I've tried creating a middleware to read api key from Authorization-Token header and do a lookup on it to find the client and their rate limits stored in a database. I then store client's rate limits in OWIN context so it can be accessed later on.
I then implemented IPolicyRepository.FirstOrDefault which appears to be getting called for all requests. Here, I'm basically returning ThrottlePolicy with the rate limits for the current client in OWIN context only.
I'm not showing all of the code, but in general this works ok. Howevert, a little cumbersome and I feel like I may be missing a feature in the library. Any suggestions?
The text was updated successfully, but these errors were encountered:
I too am interested in this. I'd like to have things data-driven so as to be able to change things dynamically without having to re-deploy. Any suggestions for best practice on this would be appreciated.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to figure out if there is a better way to load client policies w/o loading all of them on startup. I can load all via
IThrottlePolicyProvider
, but I think as the number of clients grows it would be bit on the heavy side.So far I've tried creating a middleware to read api key from Authorization-Token header and do a lookup on it to find the client and their rate limits stored in a database. I then store client's rate limits in OWIN context so it can be accessed later on.
I then implemented IPolicyRepository.FirstOrDefault which appears to be getting called for all requests. Here, I'm basically returning ThrottlePolicy with the rate limits for the current client in OWIN context only.
I'm not showing all of the code, but in general this works ok. Howevert, a little cumbersome and I feel like I may be missing a feature in the library. Any suggestions?
The text was updated successfully, but these errors were encountered: