Example #1
0
        /// <summary>
        /// Instantiates the HttpCacheHandler
        /// </summary>
        /// <param name="cacheStore">An instance of an implementation of ICacheStore</param>
        /// <param name="cacheHandlerSettings">An instance of an implementation of IHttpCacheHandlerSettings</param>
        public HttpCacheHandler(ICacheStore cacheStore, IHttpCacheHandlerSettings cacheHandlerSettings)
        {
            if (cacheStore == null)
               {
               throw new ArgumentNullException("cacheStore", "Provided ICacheStore implementation cannot be null.");
               }

               if (cacheHandlerSettings == null)
               {
               throw new ArgumentNullException("cacheHandlerSettings", "Provided IHttpCacheHandlerSettings implementation cannot be null.");
               }

               _cacheStore = cacheStore;

               _forceRevalidationOfStaleResourceRepresentations = cacheHandlerSettings.ForceRevalidationOfStaleResourceRepresentations;
               _enableConditionalPatch = cacheHandlerSettings.EnableConditionalPatch;
               _enableConditionalPut = cacheHandlerSettings.EnableConditionalPut;
               _enableClearRelatedResourceRepresentationsAfterPatch = cacheHandlerSettings.EnableClearRelatedResourceRepresentationsAfterPatch;
               _enableClearRelatedResourceRepresentationsAfterPut = cacheHandlerSettings.EnableClearRelatedResourceRepresentationsAfterPut;
        }
Example #2
0
        /// <summary>
        /// Instantiates the HttpCacheHandler
        /// </summary>
        /// <param name="cacheStore">An instance of an implementation of ICacheStore</param>
        /// <param name="cacheHandlerSettings">An instance of an implementation of IHttpCacheHandlerSettings</param>
        public HttpCacheHandler(ICacheStore cacheStore, IHttpCacheHandlerSettings cacheHandlerSettings)
        {
            if (cacheStore == null)
            {
                throw new ArgumentNullException("cacheStore", "Provided ICacheStore implementation cannot be null.");
            }

            if (cacheHandlerSettings == null)
            {
                throw new ArgumentNullException("cacheHandlerSettings", "Provided IHttpCacheHandlerSettings implementation cannot be null.");
            }

            _cacheStore = cacheStore;

            _forceRevalidationOfStaleResourceRepresentations = cacheHandlerSettings.ForceRevalidationOfStaleResourceRepresentations;
            _enableConditionalPatch = cacheHandlerSettings.EnableConditionalPatch;
            _enableConditionalPut   = cacheHandlerSettings.EnableConditionalPut;
            _enableClearRelatedResourceRepresentationsAfterPatch = cacheHandlerSettings.EnableClearRelatedResourceRepresentationsAfterPatch;
            _enableClearRelatedResourceRepresentationsAfterPut   = cacheHandlerSettings.EnableClearRelatedResourceRepresentationsAfterPut;
        }
Example #3
0
 /// <summary>
 /// Instantiates the HttpCacheHandler
 /// </summary>
 /// <param name="cacheHandlerSettings">An instance of an implementation of IHttpCacheHandlerSettings</param>
 public HttpCacheHandler(IHttpCacheHandlerSettings cacheHandlerSettings)
     : this(new ImmutableInMemoryCacheStore(), cacheHandlerSettings)
 {
 }
Example #4
0
 /// <summary>
 /// Instantiates the HttpCacheHandler
 /// </summary>
 /// <param name="cacheHandlerSettings">An instance of an implementation of IHttpCacheHandlerSettings</param>
 public HttpCacheHandler(IHttpCacheHandlerSettings cacheHandlerSettings)
     : this(new ImmutableInMemoryCacheStore(), cacheHandlerSettings)
 {
 }