Teucer's Quiver
Me && .net

Output Caching with Server.Transfer()

Sunday, February 01, 2004 4:49 AM

Me & another collegue of mine are dicsussing & implementing lot of ways by which we could improve the perf of our web app.

At one instance we could really get good performance with the use of Output caching of our asp.net pages :)

Just out of curiosity (ofcourse we knew that we are having an unnecessary roundtrip because of a Response.Redirect) hence decided about perf testing the app with Server.Transfer()!
what was a boon became a bane. On further investigation we could conclude that the page (which we eventually redirect to) which is output cached is PROCESSED / EXECUTED every time. Because Server.Transfer I believe internally calls Server.Execute or something similar to that. 

If I wish Server.Transfer could actually utilize the Output cache some how. Is this one of the things by design or is it some feature which will be rolled out some time later (Whidbey timeframe ??).

I think if I find time I shall be digging into the OutputCaching part of the runtime and find out why / why not Server.Transfer() (sh)could not support output caching ... those findings could be my next post.


Feedback

# re: Output Caching with Server.Transfer()

Server.Transfer avoids any authorization on the target page.

See my blog post here (http://dotnetjunkies.com/WebLog/darrell.norton/archive/2003/08/26/1270.aspx) for details. 2/16/2004 8:07 PM | Darrell

# re: Output Caching with Server.Transfer()

Darell,

Ofcourse I agree and I understand the reason for this is because the request never enters the HttpPipeline. If it enters then the first Http Handlers / Filters would take care of authentication and authorization.

My case is what could be the design considerations for not having implemented Support for Output caching. Digging till now I have the understanding that the OutputCache routines are actually Http Modules which are part of the Http Pipeline due to which the request has to pass the request queue so as to fetch some page / control output from the output cache.

IMHO I think this wouldbe more or less just the necessary check on the part of the Server.Execute or Server.Transfer method code to check if the output cache has indeed got the relevant page cached or not. If cached then do not process / execute the page just throw the output from the output cache itself.

I am still thinking of various reasons. lets c ... 2/26/2004 2:19 AM | Teucer

# re: Output Caching with Server.Transfer()

Teucer,
Did you find a way to force the page to write to the outputcache even if it came through a server.transfer? Ive been looking into it myself and it seems that if the original request doesnt match the current page name then it doesnt get into the outputcache at all. Im trying to override this logic to force the page to be written to the cache with the original url as its key. Any ideas?

ian 10/15/2005 3:26 AM | Ian

Post a comment