public override string ToString()
{
List<string> x = new List<string>();
//"no-cache"
//"no-cache" [ "=" <"> 1#field-name <">
if (this.NoCache)
{
x.Add(Make("no-cache", noCacheHeaders));
}
//"no-store"
if (this.NoStore)
{
x.Add("no-store");
}
//"max-age" "=" delta-seconds
if (this.MaxAge.HasValue)
{
x.Add(Make("max-age", this.MaxAge.Value));
}
//"max-stale" [ "=" delta-seconds ]
if (this.MaxStale)
{
if (this.MaxStaleLimit.HasValue)
{
x.Add(Make("max-stale", this.MaxStaleLimit.Value));
}
else
{
x.Add("max-stale");
}
}
//"min-fresh" "=" delta-seconds
if (this.MinFresh.HasValue)
{
x.Add(Make("min-fresh", this.MinFresh.Value));
}
//"must-revalidate"
if (this.MustRevalidate)
{
x.Add("must-revalidate");
}
//"no-transform"
if (this.NoTransform)
{
x.Add("no-transform");
}
//"only-if-cached"
if (this.OnlyIfCached)
{
x.Add("only-if-cached");
}
//"private" [ "=" <"> 1#field-name <"> ]
if (this.Private)
{
x.Add(Make("private", privateHeaders));
}
//"proxy-revalidate"
if (this.ProxyRevalidate)
{
x.Add("proxy-revalidate");
}
//"public"
if (this.Public)
{
x.Add("public");
}
if (this.SharedMaxAge.HasValue)
{
x.Add(Make("s-maxage", this.SharedMaxAge.Value));
}
//cache-extension
if (this.extensions != null)
{
foreach (var e in this.extensions)
{
x.Add(e);
}
}
return string.Join(", ", x.ToArray());
}
static TimeSpan GetDeltaSeconds(string directive)