Hi Jason,
Thank you for posting.
As for the OutputCache configuration you mentioned, I'm wondering whether
you're developing the application upon ASP.NET 1.x or ASP.NET 2.0. Based
on my research, ASP.NET 1.x only provide declarative or programmatic
interfaces for configuring outputCache, and declarative approach need us to
specify the outputCache setting in the @OutputCache directive in aspx
template.
In ASP.NET 2.0, there does provide new configuration setting in the
application config file(web.config or machine.config ). Those settings can
help define some global level cache profiles(somewhat like cache setting
template), and we can apply these template profile to any page in our web
application. You can get the detailed info in the following msdn reference:
#Cache Configuration in ASP.NET
http://msdn2.microsoft.com/en-us/library/ms178606.aspx
However, the above approach still require us to add the profile setting in
each individual aspx page like:
<%@ OutputCache CacheProfile="MyCacheProfile1" %>
So far there still lack a configuration setting which can directly put an
outputCache for all the pages in the application. If you do want to apply
OutputCache on all the pages or a certain group of pages in an ASP.NET
application, you can consider use code to programmatically set the Page
Response's Cache properties. e.g:
============================
void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.Server);
...............
}
============================
The above code use the appliation's global class's "BeginRequest" event to
set the cache properties on the HttpResponse. Also, based on my research,
the @OutputCache directive used in aspx template actually is compiled as an
internal function which is called by the dynamic compiled page class in a
initialize function named "FrameworkInitialize()", we can use reflector to
check the dynamic generated page assembly to verify this. And If you would
like to programmatically configure the cache properties, you can reference
to the autogenerated code:
=====================
protected override void FrameworkInitialize()
{
this.StyleSheetTheme = "White";
base.FrameworkInitialize();
this.__BuildControlTree(this);
base.AddWrappedFileDependencies(outputcache_ocpage _aspx.__fileDependencies);
// this is the runtime generated code for initlizing caching
this.InitOutputCache(outputcache_ocpage_aspx.__out putCacheSettings);
base.Request.ValidateInput();
}
=========================
Hope this helps some.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)