Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
As part of f99b482 code is DistributedSession.CommitsAsync
was modified to check IsAvailable
.
IsAvailable
always loads session from backing store and loads it in synchronous way.
On the other hand SessionMiddleware
always calls DistributedSession.CommitAsync
to save session. This means that in 6.0 session is always loaded even if application code did not touch it at all. In case of using Redis as backing store this incurs two Redis calls on each RazorPage rendered.
In the past (5.0) when session was not touched DistributedSession._isModified
prevented session data from being loaded when session was not modified.
@pranavkm Could you tell why IsAvailable
was moved?
Expected Behavior
Don't loading session data from backing store when session data is not modified by app code.
.NET Version
6.0.300