+ cmp = String.Compare ("OutputCache", directive, true);
+ if (cmp == 0) {
+ output_cache = true;
+
+ if (atts ["Duration"] == null)
+ ThrowParseException ("The directive is missing a 'duration' attribute.");
+ if (atts ["VaryByParam"] == null)
+ ThrowParseException ("This directive is missing a 'VaryByParam' " +
+ "attribute, which should be set to \"none\", \"*\", " +
+ "or a list of name/value pairs.");
+
+ foreach (DictionaryEntry entry in atts) {
+ string key = (string) entry.Key;
+ switch (key.ToLower ()) {
+ case "duration":
+ oc_duration = Int32.Parse ((string) entry.Value);
+ if (oc_duration < 1)
+ ThrowParseException ("The 'duration' attribute must be set " +
+ "to a positive integer value");
+ break;
+ case "varybyparam":
+ oc_param = (string) entry.Value;
+ if (String.Compare (oc_param, "none") == 0)
+ oc_param = null;
+ break;
+ case "varybyheader":
+ oc_header = (string) entry.Value;
+ break;
+ case "varybycustom":
+ oc_custom = (string) entry.Value;
+ break;
+ case "location":
+ if (!(this is PageParser))
+ goto default;
+
+ try {
+ oc_location = (OutputCacheLocation) Enum.Parse (
+ typeof (OutputCacheLocation), (string) entry.Value, true);
+ } catch {
+ ThrowParseException ("The 'location' attribute is case sensitive and " +
+ "must be one of the following values: Any, Client, " +
+ "Downstream, Server, None, ServerAndClient.");
+ }
+ break;
+ case "varybycontrol":
+ if (this is PageParser)
+ goto default;
+
+ oc_controls = (string) entry.Value;
+ break;
+ case "shared":
+ if (this is PageParser)
+ goto default;
+
+ try {
+ oc_shared = Boolean.Parse ((string) entry.Value);
+ } catch {
+ ThrowParseException ("The 'shared' attribute is case sensitive" +
+ " and must be set to 'true' or 'false'.");
+ }
+ break;
+ default:
+ ThrowParseException ("The '" + key + "' attribute is not " +
+ "supported by the 'Outputcache' directive.");
+ break;
+ }
+
+ }
+
+ return;
+ }
+