/// <summary> /// Used in Gloabal.asax to setup this CacheManager to handle paths where the RouteOptions.BasePath /// leading directory is used to distinguish the paths /// </summary> /// <param name="routes"></param> /// <param name="opts"></param> public static void RegisterDefault(RouteCollection routes, CachingOptions opts = null) { opts = opts ?? new CachingOptions(); var path = string.Format("{0}/{{hash}}/{{type}}/{{*path}}", opts.BasePath); var mgr = new CacheManager(LoadAssets(opts.CacheFile), opts); routes.Insert(0, new Route(path, new CacheHandler(mgr))); Instance = mgr; }
public CacheHandler(CacheManager combined) { Cache = combined; }