public static HashForKey ( string plainText ) : string | ||
plainText | string | |
return | string |
/// <summary> /// Used to Set objects in cache for a set timout lenght of time. /// </summary> /// <param name="key"></param> /// <param name="data"></param> static public void Set(string key, Object data, double cachetimeout, CacheDependency dependency) { string hashkey = string.Empty; hashkey = Cache.HashForKey(key); try { if (HttpRuntime.Cache[hashkey] != null) { HttpRuntime.Cache.Remove(hashkey); } if (cachetimeout < 0 && dependency == null) { HttpRuntime.Cache.Insert(hashkey, data); } else { HttpRuntime.Cache.Insert(hashkey, data, dependency, DateTime.Now.AddSeconds(cachetimeout), System.Web.Caching.Cache.NoSlidingExpiration); } } catch (Exception e) { throw new Exception(e.Message); } }
/// <summary> /// Used to Fetch RDF data or Presentation data from cache. /// </summary> /// <param name="request"></param> /// <returns></returns> static public XmlDocument Fetch(string key) { XmlDocument xmlrtn = null; string hashkey = string.Empty; hashkey = Cache.HashForKey(key); try { if (HttpRuntime.Cache[hashkey] != null) { xmlrtn = (XmlDocument)HttpRuntime.Cache[hashkey]; } } catch (Exception e) { throw new Exception(e.Message); } return(xmlrtn); }