-
Notifications
You must be signed in to change notification settings - Fork 4k
Cache the CheckSessionResult Script string #3823
Cache the CheckSessionResult Script string #3823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tornhoof I don't think this is necessary since the IdentityServerOptions
is a singleton and thus for the lifetime of the application this value will never change. See AddRequiredPlatformServices.
I would suggest replacing the cookie name on the first request and store the formatted html for all following requests in a static field.
@msschl |
@Tornhoof you are totally right. Sry I missed that. |
@Tornhoof -- i can't tell if you saw my comments? dunno if it's a review thing in github i did wrong. |
Sorry, I can't see your comments. |
ok, how's that? |
Ok, we'll just leave it as is then. Thanks. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What issue does this PR address?
Reduces the allocations in CheckSessionResult by chaching the formatted string.
The script string shows up consistently as the largest string (~11k chars, 24k bytes) in my memorydumps, because the cookieName is replaced for each CheckSessionResult again.
I don't think that the cookieName is changed that often during runtime (if at all), so I cache the formatted string in a variable with checks via double locking.
Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements
Other information: