Query Caching

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Random

    #1

    Query Caching

    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.


  • Dino Chiesa [Microsoft]

    #2
    Re: Query Caching

    [WebMethod(Cache Duration=60)]

    see



    Or if you want more granular control over the expiration of cached objects,
    then you should examine the System.Web.Cach ing API,
    http://msdn.microsoft.com/library/en...WebCaching.asp

    There are tons of examples of how to use this,
    eg


    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" <cipherlad@hotm ail.com> wrote in message
    news:eb4inr1bEH A.3596@tk2msftn gp13.phx.gbl...[color=blue]
    > What about query caching in a Web Service? I am creating a Web Service[/color]
    that[color=blue]
    > I would like to have some database information persist in memory as long[/color]
    as[color=blue]
    > requests are being issued against the service, but periodically or[/color]
    forcibly[color=blue]
    > refreshed when updates are made in the database.
    >
    >[/color]


    Comment

    Working...