예제 #1
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public static void Impl(ICacheability handler, IContext context)
        {
            CacheOptions cacheOptions;
            if ((cacheOptions = handler.CacheOptions) == null) return;

            context.Response.SetCacheOptions(cacheOptions);
        }
예제 #2
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public static void Impl(ICacheability handler, IContext context)
        {
            if (handler.CacheOptions.Disable)
            {
                context.Response.DisableCache();
                return;
            }
            if (handler.CacheOptions.AbsoluteExpiry.HasValue)
            {
                context.Response.SetCacheAbsoluteExpiry(handler.CacheOptions.AbsoluteExpiry.Value);
            }
            else if (handler.CacheOptions.SlidingExpiry.HasValue)
            {
                context.Response.SetCacheSlidingExpiry(handler.CacheOptions.SlidingExpiry.Value);
            }
            else
            {
                return;
            }

            if (handler.CacheOptions.VaryByContentEncodings != null)
            {
                context.Response.SetCacheVaryByContentEncodings(handler.CacheOptions.VaryByContentEncodings);
            }
        }
예제 #3
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public static void Impl(ICacheability handler, IContext context)
        {
            CacheOptions cacheOptions;

            if ((cacheOptions = handler.CacheOptions) == null)
            {
                return;
            }

            context.Response.SetCacheOptions(cacheOptions);
        }