Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2008

Tip: Looking for answers? Try searching our database.

Method cache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JerryY - 03 Apr 2008 15:34 GMT
I have a web service with two public methods foo and faa.  Neither are
cached.  
I also have an internal method called cacheIt.  This one is setup to be
cached.  

If both foo and faa make calls to cacheIt, will the method cacheIt be
cached?  Or must both foo and faa be cached?  

cacheIt has the data that I want to cache.  

thanks

Signature

Jerry

Patrice - 03 Apr 2008 18:17 GMT
I'm not sure what you call a "cached method". Data are cached not methods...

Both foo and faa will just get what cacheIt returned to them so if cacheIt
returns cached data, both foo and faa (or any other method that would call
cacheIt) will deal with what cacheIt returned that is cached data (anyway
they have no way to know what are the real data cached by cacheIt and no way
to overcome this cache ???)...

You may want to elaborate a bit as the context is unclear, what do you mean
by having "cacheIt setup to be cached" ? You perhaps talking about something
else than what I thought...

--
Patrice

>I have a web service with two public methods foo and faa.  Neither are
> cached.
[quoted text clipped - 7 lines]
>
> thanks
JerryY - 03 Apr 2008 18:37 GMT
Thanks you your quick reply.  

by method cache I mean in the
[WebMethod(Description=@"Log successful retrieval of manifest for given
rivision.", CacheDuration=300)]
You can set the cache duration.  
My understanding is that as long as the method parameters do not change
between calls, the "page" is cached.  

Signature

Jerry

> I'm not sure what you call a "cached method". Data are cached not methods...
>
[quoted text clipped - 22 lines]
> >
> > thanks
Patrice - 03 Apr 2008 18:55 GMT
Ah AFAIK it caches the XML response sent by the method to a client over
http...

Of course it won't have any effect if the method is not called throught a
webservice call but directly....

Remember also that you have server side caching available :
http://msdn2.microsoft.com/en-us/library/system.web.caching.cache.aspx

--
Patrice

> Thanks you your quick reply.
>
[quoted text clipped - 40 lines]
>> >
>> > thanks
JerryY - 03 Apr 2008 19:14 GMT
Yea I did the server side cache as a temp fix.  
But that has it's own issues.  
(appName is passed as a parameter)

DataSet ds = null;
Object obj = Context.Cache.Get(appName);
if (obj == null)
{
//if not present, create a new manifest for first time
ds = new DataSet();
ds.ReadXml(...);
Context.Cache.Insert(appName, ds);
}
else
{
ds = (DataSet) obj;
}
return ds;

If say I have 30 requests at the same time(first time service is started
up), the dataset is going to be created 30 times (because at that second when
30 requests are processed, the cache is empty) and the last one in is the one
that will be used in the cache.  The 31st reqeust will use what is in the
cache.  

Signature

Jerry

> Ah AFAIK it caches the XML response sent by the method to a client over
> http...
[quoted text clipped - 52 lines]
> >> >
> >> > thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.