/// <summary>Gets this cache info as a JSON object. /// Returns null if it's empty.</summary> public JSObject ToJson() { if (IsEmpty) { return(null); } JSObject obj = new JSObject(); obj["host"] = new JSValue(Host); if (Cookies != null && !Cookies.IsEmpty) { obj[Cookies.JsonIndex] = Cookies.ToJson(); } if (Content != null && !Content.IsEmpty) { obj[Content.JsonIndex] = Content.ToJson(); } return(obj); }