I am currently building rest services that authenticate user against a kerberos domain controller. Since poking the KDC everytime a user tries to do an action in the system is time-consuming, I have a cache where I store an authentication token with its related principal.
So basically, my services offer two authentication schemes: Kerberos and by token. The problem I have is my cache object (scoped as singleton in my DI container) is lost when the app pool is recycled. Also, even if the app pool is not recycled, this behaviour prevent me from distributing my services over multiple servers.
How can I persist my cache object accross app pools?