Skip to content

Compute authenticatable_name once per strategy class - #5872

Open
sampokuokkanen wants to merge 1 commit into
heartcombo:mainfrom
sampokuokkanen:memoize-authenticatable-name
Open

sampokuokkanen wants to merge 1 commit into
heartcombo:mainfrom
sampokuokkanen:memoize-authenticatable-name

Conversation

@sampokuokkanen

Copy link
Copy Markdown

Warden instantiates strategies on every request, so the per-instance @authenticatable_name memo never hits: every request that runs the strategies' valid? (any request with no user in the session that calls authenticate/current_user) splits, underscores and subs the class name again for each strategy. Cache it on the strategy class instead.

Warden instantiates strategies on every request, so the per-instance
@authenticatable_name memo never hits: every request that runs the
strategies' valid? (any request with no user in the session that calls
authenticate/current_user) splits, underscores and subs the class name
again for each strategy. Cache it on the strategy class instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant