tbroyer
02-19-2007, 02:06 PM
Hi Bruno,
Your last version (20070218-1949) never takes advantage of the ASP.NET Cache:
object webServiceData = context.Cache.Get(filename);
…
context.Cache.Insert("System.Web.Script.Services.WebServiceData:" + filename, webServiceData);
I'm already using this code in a project at work and, to accomodate the 1.0 "final" release of ASP.NET AJAX, I modified it as follow:
static private readonly MethodInfo webServiceData_GetCacheKey =
webServiceDataType.GetMethod("GetCacheKey", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(string) }, null);
…
string cacheKey = (string) webServiceData_GetCacheKey.Invoke(null, new object[] {
VirtualPathUtility.ToAbsolute(context.Request.File Path)
});
object webServiceData = context.Cache.Get(cacheKey);
…
context.Cache.Insert(cacheKey, webServiceData);
You'll hopefull find where those lines go ;)
Your last version (20070218-1949) never takes advantage of the ASP.NET Cache:
object webServiceData = context.Cache.Get(filename);
…
context.Cache.Insert("System.Web.Script.Services.WebServiceData:" + filename, webServiceData);
I'm already using this code in a project at work and, to accomodate the 1.0 "final" release of ASP.NET AJAX, I modified it as follow:
static private readonly MethodInfo webServiceData_GetCacheKey =
webServiceDataType.GetMethod("GetCacheKey", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(string) }, null);
…
string cacheKey = (string) webServiceData_GetCacheKey.Invoke(null, new object[] {
VirtualPathUtility.ToAbsolute(context.Request.File Path)
});
object webServiceData = context.Cache.Get(cacheKey);
…
context.Cache.Insert(cacheKey, webServiceData);
You'll hopefull find where those lines go ;)