Skip to content

Conversation

@EiNSTeiN-
Copy link

The get_session_model method will store a reference to the model in request.env[SESSION_RECORD_KEY] when the session is loaded. Later on when saving the session, write_session calls get_session_model, which again calls the active record finder methods to load the model.

In a standard Rails app, this would presumably hit the active record cache and not hit mysql twice, but if the active record cache is invalidated during the request or if @@session_class#find_by_session_id was overloaded to do anything else (like perhaps read from an external cache), then the app will end up doing unnecessary work.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant