How to add cache to current_active_user #1387
-
Hello! How to add cache to current active user? I'm a little worried that every visit to a protected endpoint makes a request to the database |
Beta Was this translation helpful? Give feedback.
Answered by
frankie567
Apr 18, 2024
Replies: 1 comment 1 reply
-
Unless you heavily modify the Authenticator class, that's not easily doable. That said, you shouldn't be too worried about the DB query. It's fast and guarantees you maximum security (since we check at each request the existence and state of the user). 99% of web frameworks out there are doing it like this. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dima23113
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unless you heavily modify the Authenticator class, that's not easily doable.
That said, you shouldn't be too worried about the DB query. It's fast and guarantees you maximum security (since we check at each request the existence and state of the user). 99% of web frameworks out there are doing it like this.