"Roshawn Dawson" <ud****@bellsou th.net> wrote in message news:uN******** ******@TK2MSFTN GP10.phx.gbl...
This web user control obtains its data from a web service. If I were to use
fragment caching (<%@ OutputCache Duration="3600" %>) with this control,
will it call the web service each time the page is requested or will it continue to
use the web service data until the cache duration expires?
The answer is Yes, output caching the user control (fragment caching) will
reduce the number of calls you're making to the web service.
Fragment caching produces the HTML from the user control the first-time it
gets requested which will include calling your web service. Thereafter, until
the fragment of HTML associated with your user control in the output cache
expires, ASP.NET will render the HTML that's been stored (and not perform
any dynamic processing of your user control, therefore it would not call the
web service). When the fragment in the cache expires, and a request comes
in that requires the HTML of your user control, then ASP.NET will again
perform the dynamic processing in your control (including a call to the web
service) to create a refreshed fragment which it will then return (and cache)
for another 3,600 seconds.
Derek Harmon