public static HandlerMethods GetHandlerMethodsByType(HttpContext context, Type type, string requestPath, bool ignoreCache)
{
string cacheKey = HandlerMethods.CACHE_PREFIX.ConcatWith(requestPath, type.Namespace, type.Name);
HandlerMethods handlerMethods = null;
if (!IsDebugging && !ignoreCache)
{
handlerMethods = context.Cache[cacheKey] as HandlerMethods;
}
if (handlerMethods == null)
{
handlerMethods = new HandlerMethods(type);
if (!IsDebugging && !ignoreCache)
{
if (requestPath.IsEmpty() || !Directory.Exists(requestPath))
{
context.Cache.Insert(cacheKey, handlerMethods);
}
else
{
context.Cache.Insert(cacheKey, handlerMethods, new CacheDependency(context.Server.MapPath(requestPath)));
}
}
}
return handlerMethods;
}