示例#1
0
        protected override void Setup(TimeSpan?expirationScanFrequency)
        {
            IOptions <FileSystemBundleCacheOptions> options = Options.Create(new FileSystemBundleCacheOptions
            {
                FileProvider = new PhysicalFileProvider(Environment.CurrentDirectory)
            });

            var memoryCache = new MemoryCache(Options.Create(new MemoryCacheOptions
            {
                Clock = Clock,
                ExpirationScanFrequency = expirationScanFrequency ?? default(TimeSpan),
            }));

            _cache = new MemoryBundleCache(memoryCache,
                                           Options.Create(new BundleGlobalOptions
            {
                EnableChangeDetection = true
            }));
        }
示例#2
0
        protected override void Setup(TimeSpan?expirationScanFrequency)
        {
            var options = Options.Create(new FileSystemBundleCacheOptions
            {
                FileProvider = new PhysicalFileProvider(Environment.CurrentDirectory)
            });

            var loggerProvider = new ConsoleLoggerProvider((s, l) => l >= LogLevel.Warning, true);
            var loggerFactory  = new LoggerFactory(new[] { loggerProvider });

            var memoryCache = new MemoryCache(Options.Create(new MemoryCacheOptions
            {
                Clock = Clock,
                ExpirationScanFrequency = expirationScanFrequency ?? default(TimeSpan),
            }));

            _cache = new MemoryBundleCache(memoryCache,
                                           Options.Create(new BundleGlobalOptions
            {
                EnableChangeDetection = true
            }));
        }