ソースを参照

* Page.cs: Always set the cache expire time. Tell the response to
cache itself for server side cached pages.

svn path=/trunk/mcs/; revision=20269

Jackson Harper 22 年 前
コミット
72dad0ad49

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

@@ -1,3 +1,8 @@
+2003-11-19  Jackson Harper <[email protected]>
+
+	* Page.cs: Always set the cache expire time. Tell the response to
+	cache itself for server side cached pages.
+	
 2003-11-19  Jackson Harper <[email protected]>
 
 	* Control.cs: Remove ResolveBaseUrl. ResolveUrl does the same

+ 4 - 4
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -422,25 +422,25 @@ public class Page : TemplateControl, IHttpHandler
 				foreach (string h in hdrs)
 					cache.VaryByHeaders [h.Trim ()] = true;
 			}
-			
+			_context.Response.CacheResponse (_context.Request);
 			goto case OutputCacheLocation.Downstream;
 		case OutputCacheLocation.Client:
 			cache.SetCacheability (HttpCacheability.Private);
-			cache.SetExpires (DateTime.Now.AddSeconds (duration));
 			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
 			cache.SetLastModified (_context.Timestamp);
 			break;
 		case OutputCacheLocation.Downstream:
 			cache.SetCacheability (HttpCacheability.Public);
-			cache.SetExpires (DateTime.Now.AddSeconds (duration));
 			cache.SetMaxAge (new TimeSpan (0, 0, duration));		
 			cache.SetLastModified (_context.Timestamp);
 			break;
 		case OutputCacheLocation.Server:
+			_context.Response.CacheResponse (_context.Request);
 			goto case OutputCacheLocation.None;
 		case OutputCacheLocation.None:
 			break;
 		}
+		cache.SetExpires (_context.Timestamp.AddSeconds (duration));
 	}
 
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -722,7 +722,7 @@ public class Page : TemplateControl, IHttpHandler
 			hiddenFields.Add (hiddenFieldName, hiddenFieldInitialValue);
 	}
 	
- 	[MonoTODO]
+	[MonoTODO]
 	public void RegisterClientScriptFile (string a, string b, string c)
 	{
 		throw new NotImplementedException ();