cache and web-farm

Posted by user285336 on Stack Overflow See other posts from Stack Overflow or by user285336
Published on 2010-05-07T19:43:59Z Indexed on 2010/05/07 19:48 UTC
Read the original article Hit count: 302

Filed under:
|

I need to deploy my web-application on web-farm. Application has the following strings:

public static X509Certificate2 GetIdCertificate()
{
    string cacheKey = "Neogov.Insight.IdentityProvider.PrivateKey";

    if (HttpContext.Current.Cache[cacheKey] == null)
    {                
        //Load new.
        HttpContext.Current.Cache[cacheKey] = new X509Certificate2(
        System.Web.HttpContext.Current.Server.MapPath("~/") + "\\ID\\" +
        Neogov.Insight.IdentityProvider.BLL.IdConfig.Instance.IdPKeyFile, 
        Neogov.Insight.IdentityProvider.BLL.IdConfig.Instance.IdPKeyPassword,
        X509KeyStorageFlags.MachineKeySet);
    }

    return (X509Certificate2)HttpContext.Current.Cache[cacheKey];
}

will it work or not? If not then how to solve and what is solution?

Thanks

© Stack Overflow or respective owner

Related posts about web-farm

Related posts about cache