Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }