[WebMethod(CacheDuration=60)]
see
http://support.microsoft.com/default...b;en-us;318299
Or if you want more granular control over the expiration of cached objects,
then you should examine the System.Web.Caching API,
http://msdn.microsoft.com/library/en...WebCaching.asp
There are tons of examples of how to use this,
eg
http://aspalliance.com/articleViewer.aspx?aId=66&pId=
But your scenario seems pretty simple; just update the expiration with
every method call that touches the cache. You say you want the cache to
live "as long as requests are being issued". You probably will have to
identify some interval of inactivity after which you will declare that
"requests are no longer being issued". Whatever that interval is, is the
one to use when setting the cache lifetime.
-D
"Random" <ci*******@hotmail.com> wrote in message
news:eb**************@tk2msftngp13.phx.gbl...
What about query caching in a Web Service? I am creating a Web Service
that I would like to have some database information persist in memory as long
as requests are being issued against the service, but periodically or
forcibly refreshed when updates are made in the database.