Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorJackson Harper <jackson@novell.com>2004-02-16 23:54:36 +0300
committerJackson Harper <jackson@novell.com>2004-02-16 23:54:36 +0300
commit8479ee6534adfd66f7644dacf33bf68430c69765 (patch)
tree8668fee8525e10152ee26d48bd3e4e69d9c9fd88 /mcs
parent5211dc2d80cedced00abf39e48a5d5d4d7b9ea0f (diff)
* Page.cs: Set cacheability for Location.DownStream.
svn path=/trunk/mcs/; revision=23147
Diffstat (limited to 'mcs')
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/Page.cs20
1 files changed, 13 insertions, 7 deletions
diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs
index 0b54123db4a..1adb4a73838 100755
--- a/mcs/class/System.Web/System.Web.UI/Page.cs
+++ b/mcs/class/System.Web/System.Web.UI/Page.cs
@@ -415,13 +415,15 @@ public class Page : TemplateControl, IHttpHandler
string varyByParam)
{
HttpCachePolicy cache = _context.Response.Cache;
+ bool set_vary = false;
switch (location) {
case OutputCacheLocation.Any:
cache.SetCacheability (HttpCacheability.Public);
cache.SetMaxAge (new TimeSpan (0, 0, duration));
cache.SetLastModified (_context.Timestamp);
- goto case OutputCacheLocation.Server;
+ set_vary = true;
+ break;
case OutputCacheLocation.Client:
cache.SetCacheability (HttpCacheability.Private);
cache.SetMaxAge (new TimeSpan (0, 0, duration));
@@ -432,7 +434,15 @@ public class Page : TemplateControl, IHttpHandler
cache.SetMaxAge (new TimeSpan (0, 0, duration));
cache.SetLastModified (_context.Timestamp);
break;
- case OutputCacheLocation.Server:
+ case OutputCacheLocation.Server:
+ cache.SetCacheability (HttpCacheability.Server);
+ set_vary = true;
+ break;
+ case OutputCacheLocation.None:
+ break;
+ }
+
+ if (set_vary) {
if (varyByCustom != null)
cache.SetVaryByCustom (varyByCustom);
@@ -450,12 +460,8 @@ public class Page : TemplateControl, IHttpHandler
foreach (string h in hdrs)
cache.VaryByHeaders [h.Trim ()] = true;
}
-
- cache.SetCacheability (HttpCacheability.Server);
- break;
- case OutputCacheLocation.None:
- break;
}
+
cache.Duration = duration;
cache.SetExpires (_context.Timestamp.AddSeconds (duration));
}