@@ -294,7 +294,7 @@ public bool IsAcceptableEncoding(string contentEncoding, string acceptEncoding)
294
294
}
295
295
double weight = GetAcceptableEncodingHelper ( contentEncoding , acceptEncoding ) ;
296
296
return ! ( weight == 0 ) &&
297
- ( ! ( weight <= 0 ) || GetAcceptableEncodingHelper ( Asterisk , acceptEncoding ) = = 0 ) ;
297
+ ( ! ( weight <= 0 ) || GetAcceptableEncodingHelper ( Asterisk , acceptEncoding ) ! = 0 ) ;
298
298
}
299
299
300
300
public bool IsResponseCacheable ( ) {
@@ -509,7 +509,7 @@ private bool HasDependencyChanged(string depKey, string[] fileDeps, string kerne
509
509
DependencyCacheTimeSpan = Cache . NoSlidingExpiration ,
510
510
DependencyRemovedCallback = null
511
511
} ;
512
- memoryCache . Add ( depKey , dcew , DateTimeOffset . MaxValue ) ;
512
+ memoryCache . Set ( depKey , dcew , DateTimeOffset . MaxValue ) ;
513
513
return false ;
514
514
}
515
515
// file dependencies have changed
@@ -596,24 +596,22 @@ private async Task InsertResponseAsync(string cachedVaryKey,
596
596
string depKey = OutputcacheKeyprefixDependencies + dependencies . GetUniqueID ( ) ;
597
597
OutputCacheEntry oce = Convert ( rawResponse , depKey , dependencies . GetFileDependencies ( ) ) ;
598
598
await provider . SetAsync ( rawResponseKey , oce , absExp ) ;
599
- {
600
- // use Add and dispose dependencies if there's already one in the cache
601
- var dce = new DependencyCacheEntry {
602
- RawResponseKey = rawResponseKey ,
603
- KernelCacheUrl = oce . KernelCacheUrl ,
604
- Name = provider . Name
605
- } ;
606
- var dcew = new DependencyCacheEntryWrapper {
607
- DependencyCacheEntry = dce ,
608
- Dependencies = dependencies ,
609
- CacheItemPriority = System . Web . Caching . CacheItemPriority . Normal ,
610
- DependencyCacheTimeSpan = Cache . NoSlidingExpiration ,
611
- DependencyRemovedCallback = null
612
- } ;
613
- object d = await provider . AddAsync ( depKey , dcew , absExp ) ;
614
- if ( d != null ) {
615
- dependencies . Dispose ( ) ;
616
- }
599
+ // use Add and dispose dependencies if there's already one in the cache
600
+ var dce = new DependencyCacheEntry {
601
+ RawResponseKey = rawResponseKey ,
602
+ KernelCacheUrl = oce . KernelCacheUrl ,
603
+ Name = provider . Name
604
+ } ;
605
+ var dcew = new DependencyCacheEntryWrapper {
606
+ DependencyCacheEntry = dce ,
607
+ Dependencies = dependencies ,
608
+ CacheItemPriority = System . Web . Caching . CacheItemPriority . Normal ,
609
+ DependencyCacheTimeSpan = Cache . NoSlidingExpiration ,
610
+ DependencyRemovedCallback = null
611
+ } ;
612
+ object d = await provider . AddAsync ( depKey , dcew , absExp ) ;
613
+ if ( d != null ) {
614
+ dependencies . Dispose ( ) ;
617
615
}
618
616
}
619
617
}
0 commit comments