private static object CacheToJsonModel(StaticContentSection.HttpClientCacheElement cache)
        {
            string controlMode = null;

            switch (cache.CacheControlMode)
            {
            case MimeTypesGlobals.HttpCacheControlMode.DisableCache:
                controlMode = "disable_cache";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.NoControl:
                controlMode = "no_control";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.UseExpires:
                controlMode = "use_expires";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.UseMaxAge:
                controlMode = "use_max_age";
                break;

            default:
                break;
            }

            return(new {
                control_mode = controlMode,
                max_age = (long)cache.CacheControlMaxAge.TotalMinutes,
                http_expires = cache.HttpExpires.ToString("r"),
                control_custom = cache.CacheControlCustom,
                set_e_tag = cache.SetETag
            });
        }
        private static object CacheToJsonModel(StaticContentSection.HttpClientCacheElement cache)
        {
            string controlMode = null;

            switch (cache.CacheControlMode)
            {
            case MimeTypesGlobals.HttpCacheControlMode.DisableCache:
                controlMode = "disable_cache";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.NoControl:
                controlMode = "no_control";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.UseExpires:
                controlMode = "use_expires";
                break;

            case MimeTypesGlobals.HttpCacheControlMode.UseMaxAge:
                controlMode = "use_max_age";
                break;

            default:
                break;
            }

            dynamic obj = new ExpandoObject();

            obj.control_mode   = controlMode;
            obj.max_age        = (long)cache.CacheControlMaxAge.TotalMinutes;
            obj.http_expires   = cache.HttpExpires.ToString("r");
            obj.control_custom = cache.CacheControlCustom;

            if (cache.Schema.HasAttribute(SetETagAttribute))
            {
                obj.set_e_tag = cache.SetETag;
            }

            return(obj);
        }