Skip to content

Cache UPNs by SID for 30 seconds - #172

Closed
fluggo wants to merge 1 commit into
npgsql:masterfrom
fluggo:master
Closed

fluggo wants to merge 1 commit into
npgsql:masterfrom
fluggo:master

Conversation

@fluggo

@fluggo fluggo commented Feb 24, 2014

Copy link
Copy Markdown

This should solve the complaint of speed problems in #162.

This should solve the complaint of speed problems in #162.
@franciscojunior

Copy link
Copy Markdown
Member

Hi @fluggo !

Would you please rename the __cachedUpns to cacheUpns? This would help us keep a consistent variable naming.

I'd like to discuss which strategy would be better regarding this cache. Is it better that we add an expiration or not? If we go with the expiration strategy, which value would be good? As @the21st commented in #162, #162 (comment), 30 seconds is too low. You were thinking about 24 hours. But what happens if the authentication information of the user changes in the meantime?

My point is that I think we shouldn't use any expiration strategy. If the credentials change, the application would need to be restarted. As you said, this information would rarely change.

If it really does, the probability of this change timing coincides with the expiration timing is very low and either the user would need to this timeout to reach or the application would need to be take down anyway.

I think that if we remove the expiration and taking down the application to reflect any authentication changes becomes an annoyance, I think we could create a method to clear this cache.

I'm saying all that because I think that any low value of this timeout would bring delays to the most used scenario.

I hope I'm not being too much confusing...

What do you think?

@fluggo

fluggo commented Feb 27, 2014

Copy link
Copy Markdown
Author

Yeah, I was trying to think of the poor sap who is running a long-lived service or something and doesn't know why a particular user can't log in, and I thought it would be nice if the application righted itself after awhile. I doubt many people would think to call a ClearUpnCache method. It's your library, though!

Also, sorry about the __cachedUpns. I saw single-underscore names in that class, and I tend to name static variables with double underscores.

If you want to go with no timeout and a static ClearUpnCache() method, let me know.

@franciscojunior

Copy link
Copy Markdown
Member

Yeah, I was trying to think of the poor sap who is running a long-lived service or something and doesn't know why a particular user can't log in, and I thought it would be nice if the application righted itself after awhile. I doubt many people would think to call a ClearUpnCache method. It's your library, though!

Yeah, I agree with you. I also don't like the idea of having this ClearUpnCache method. I'll try to think about another alternative. If you have any idea, please, let me know.

Thank you for all your help and support on this issue, Brian!

@fluggo fluggo closed this Feb 27, 2014
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.

2 participants