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

Cache the decisions to improve the enforcement performance. #2

Closed
hsluoyz opened this issue Apr 20, 2017 · 5 comments
Closed

Cache the decisions to improve the enforcement performance. #2

hsluoyz opened this issue Apr 20, 2017 · 5 comments
Assignees

Comments

@hsluoyz
Copy link
Member

hsluoyz commented Apr 20, 2017

No description provided.

@hsluoyz hsluoyz self-assigned this Apr 20, 2017
@iantanwx
Copy link

I actually really need this for my project. Can I send a PR?

@hsluoyz
Copy link
Member Author

hsluoyz commented Oct 30, 2017

sure, please send a PR :)

@hsluoyz
Copy link
Member Author

hsluoyz commented Oct 30, 2017

Btw, I think you can implement it as a wrapper of the enforcer, like this one: https://github.com/casbin/casbin/blob/master/enforcer_synced.go

@iantanwx
Copy link

Sounds good. I was thinking of also implementing the same adapter pattern used for persistence, so that the cache can be either in-memory (default) or redis. It'll also give the user an opportunity to provide their own cache implementation in case they don't want to use the default in-memory cache.

@hsluoyz
Copy link
Member Author

hsluoyz commented Dec 8, 2018

Hi @iantanwx , CachedEnforcer has been implemented, see its usage here: https://github.com/casbin/casbin/blob/master/enforcer_cached_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants