public BundleManager( IOptions <BundlingOptions> options, IOptions <BundleContributorOptions> contributorOptions, IScriptBundler scriptBundler, IStyleBundler styleBundler, IWebHostEnvironment hostingEnvironment, IServiceProvider serviceProvider, IDynamicFileProvider dynamicFileProvider, IBundleCache bundleCache, IWebContentFileProvider webContentFileProvider, IWebRequestResources requestResources) { Options = options.Value; ContributorOptions = contributorOptions.Value; HostingEnvironment = hostingEnvironment; ScriptBundler = scriptBundler; ServiceProvider = serviceProvider; DynamicFileProvider = dynamicFileProvider; BundleCache = bundleCache; WebContentFileProvider = webContentFileProvider; RequestResources = requestResources; StyleBundler = styleBundler; Logger = NullLogger <BundleManager> .Instance; }
public StyleBundleTagHelper( IBundleCollection bundles, IBundleCache bundleCache, IOptionsMonitor <BundlingOptions> options, IWebHostEnvironment env) : base(bundles, bundleCache, options, env) { }
public BundleTagHelper( IBundleCollection bundles, IBundleCache bundleCache, IOptionsMonitor <BundlingOptions> options, IWebHostEnvironment env) { Bundles = bundles; BundleCache = bundleCache; Options = options.CurrentValue; HostEnvironment = env; }
protected BundleBase(IFileWriterFactory fileWriterFactory, IFileReaderFactory fileReaderFactory, IDebugStatusReader debugStatusReader, ICurrentDirectoryWrapper currentDirectoryWrapper, IHasher hasher, IBundleCache bundleCache) { this.fileWriterFactory = fileWriterFactory; this.fileReaderFactory = fileReaderFactory; this.debugStatusReader = debugStatusReader; this.currentDirectoryWrapper = currentDirectoryWrapper; this.hasher = hasher; ShouldRenderOnlyIfOutputFileIsMissing = false; HashKeyName = "r"; this.bundleCache = bundleCache; }
protected BundleBase(IFileWriterFactory fileWriterFactory, IFileReaderFactory fileReaderFactory, IDebugStatusReader debugStatusReader, IDirectoryWrapper directoryWrapper, IHasher hasher, IBundleCache bundleCache) { this.fileWriterFactory = fileWriterFactory; this.fileReaderFactory = fileReaderFactory; this.debugStatusReader = debugStatusReader; this.directoryWrapper = directoryWrapper; this.hasher = hasher; bundleState = new BundleState { DebugPredicate = Configuration.Instance.DefaultDebugPredicate(), ShouldRenderOnlyIfOutputFileIsMissing = false, HashKeyName = "r" }; this.bundleCache = bundleCache; }
public BundleManagerFactory(IEnumerable <IBundleModelFactory> modelFactories, IBundleCache cache, IBundleVersionProvider versionProvider, IBundleUrlHelper urlHelper, ILoggerFactory loggerFactory, ISystemClock clock, IApplicationLifetime applicationLifetime) { _modelFactories = modelFactories; _cache = cache; _versionProvider = versionProvider; _urlHelper = urlHelper; _loggerFactory = loggerFactory; _clock = clock; _shutdownToken = applicationLifetime.ApplicationStopping; _instances = new List <IBundleManager>(); }
public BundleMiddleware( RequestDelegate next, IBundleCollection collection, IBundleCache bundleCache, IBundleBuilder bundleBuilder, IOptionsMonitor <BundlingOptions> optionsMonitor, IThemeRegistry themeRegistry, ILogger <BundleMiddleware> logger) { _next = next; _collection = collection; _bundleCache = bundleCache; _bundleBuilder = bundleBuilder; _optionsMonitor = optionsMonitor; _themeRegistry = themeRegistry; _logger = logger; }
public BundleManager(int id, BundleCollection bundles, IBundlingContext bundlingContext, CancellationToken shutdownToken, IEnumerable <IBundleModelFactory> modelFactories, IBundleCache cache, IBundleVersionProvider versionProvider, IBundleUrlHelper urlHelper, ILoggerFactory loggerFactory, ISystemClock clock) { _id = id; _bundlingContext = bundlingContext; _shutdownToken = shutdownToken; _modelFactories = modelFactories; _cache = cache; _versionProvider = versionProvider; _urlHelper = urlHelper; _logger = loggerFactory.CreateLogger <BundleManager>(); _clock = clock; _bundles = bundles.ToDictionary(b => b.Path, CreateModel); }
// /// <summary> /// Store the response for this bundle instance in the appropriate caches /// </summary> /// <param name="context"></param> /// <param name="response"></param> public virtual void UpdateCache(BundleContext context, BundleResponse response) { if (context == null) { throw new ArgumentNullException("context"); } if (response == null) { throw new ArgumentNullException("response"); } IBundleCache cache = context.BundleCollection.Cache; if (cache.IsEnabled(context)) { cache.Put(context, this, response); } }
/// <summary> /// Returns the first cache hit from the context.BundleCollection.CacheList by default. /// Can override to implement custom caching logic. /// </summary> /// <param name="context"></param> /// <returns></returns> public virtual BundleResponse CacheLookup(BundleContext context) { if (context == null) { throw new ArgumentNullException("context"); } IBundleCache cache = context.BundleCollection.Cache; if (cache.IsEnabled(context)) { BundleResponse response = cache.Get(context, this); if (response != null) { return(response); } } return(null); }
public static void Enable(bool optimize, IBundleCache cache) { BundleTable.Bundles.Optimize = optimize; BundleTable.Bundles.Cache = cache; }
public JavaScriptBundle(IDebugStatusReader debugStatusReader, IFileWriterFactory fileWriterFactory, IFileReaderFactory fileReaderFactory, IDirectoryWrapper directoryWrapper, IHasher hasher, IBundleCache bundleCache) : base(fileWriterFactory, fileReaderFactory, debugStatusReader, directoryWrapper, hasher, bundleCache) { }
public CachedBundleContainerFactory(IBundleCache cache, IDictionary <Type, IBundleFactory <Bundle> > bundleFactories) : base(bundleFactories) { this.cache = cache; }
public CSSBundle(IDebugStatusReader debugStatusReader, IFileWriterFactory fileWriterFactory, IFileReaderFactory fileReaderFactory, ICurrentDirectoryWrapper currentDirectoryWrapper, IHasher hasher, IBundleCache bundleCache) : base(fileWriterFactory, fileReaderFactory, debugStatusReader, currentDirectoryWrapper, hasher, bundleCache) { }
public CachedBundleContainerFactory(IBundleCache cache, IDictionary<Type, IBundleFactory<Bundle>> bundleFactories) : base(bundleFactories) { this.cache = cache; }
public void Setup() { provider = new Mock<ICacheProvider>(); cache = new BundleCache<BundleImpl>(provider.Object); }