hello,
<%@ OutputCache Duration="3600" VaryByParam="none" %>
protected void Page_Load(object sender, EventArgs e)
{Label1.Text = DateTime.Now.ToString();}
If, after I compiled this newly created application, browser B1 is first to request Cache.aspx, then the time displayed on received page is 10.16:20. If, after say 10 seconds, I refresh B1’s Cache.aspx( by clicking a button to cause a postback), then time 10.16.30 will show up, and on all subsequent postbacks 10.16.30 will always be displayed ( until 1 hour elapses ). If few minutes after B1 first requested Cache.aspx, browser B2 also requests the same page, then upon receiving the page for the first time, B2’s Cache.aspx will display time 10.16.20, and on all subsequent B2’s postbacks time 10.16:30 will be displayed instead.
A) So it appears that Asp.net generates two cached versions of Cache.aspx ( thus code is executed twice ), one cached page is given to browsers that request Cache.aspx for the first time, and second cached page is given to browsers which only refresh their Cache.aspx?
B) Since my book never mentioned such a behavior, I’m wondering if you get the same behavior or is my Net environment again “unique”?
C) Creating two copies of same page ( thus executing the code twice ) seems like a waste of time, so why does Asp.Net operate like that – there must be some reasoning/benefits behind it?
thank you