Quellcode durchsuchen

* Page.cs: Set vary by params when cache location is Server.

svn path=/trunk/mcs/; revision=20330
Jackson Harper vor 22 Jahren
Ursprung
Commit
dde5f46fc1

+ 4 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,7 @@
+2003-11-21  Jackson Harper <[email protected]>
+
+	* Page.cs: Set vary by params when cache location is Server.
+	
 2003-11-21 Ben Maurer  <[email protected]>
 
 	* ObjectStateFormatter.cs: v2 file. In v1.x this will be

+ 16 - 14
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -405,6 +405,21 @@ public class Page : TemplateControl, IHttpHandler
 
 		switch (location) {
 		case OutputCacheLocation.Any:
+			cache.SetCacheability (HttpCacheability.Public);
+			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
+			cache.SetLastModified (_context.Timestamp);
+			goto case OutputCacheLocation.Server;
+		case OutputCacheLocation.Client:
+			cache.SetCacheability (HttpCacheability.Private);
+			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
+			cache.SetLastModified (_context.Timestamp);
+			break;
+		case OutputCacheLocation.Downstream:
+			cache.SetCacheability (HttpCacheability.Public);
+			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
+			cache.SetLastModified (_context.Timestamp);
+			break;
+		case OutputCacheLocation.Server:
 			if (varyByCustom != null)
 				cache.SetVaryByCustom (varyByCustom);
 			
@@ -423,20 +438,7 @@ public class Page : TemplateControl, IHttpHandler
 					cache.VaryByHeaders [h.Trim ()] = true;
 			}
 			_context.Response.CacheResponse (_context.Request);
-			goto case OutputCacheLocation.Downstream;
-		case OutputCacheLocation.Client:
-			cache.SetCacheability (HttpCacheability.Private);
-			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
-			cache.SetLastModified (_context.Timestamp);
-			break;
-		case OutputCacheLocation.Downstream:
-			cache.SetCacheability (HttpCacheability.Public);
-			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
-			cache.SetLastModified (_context.Timestamp);
-			break;
-		case OutputCacheLocation.Server:
-			_context.Response.CacheResponse (_context.Request);
-			goto case OutputCacheLocation.None;
+                        break;
 		case OutputCacheLocation.None:
 			break;
 		}