« Previous Next »

Thread: Stored context that live longer than request state

Last post 10-29-2009 10:22 PM by DF_Frederic. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-28-2009, 10:53 PM

    Stored context that live longer than request state

    We have a module that process every request on the web server.  In that case, it seems that it could be useful to keep the configuration in a context. 

     

    If the context is saved only for the request state and the module doesn't do any sub request, I don't see much interest since it would be the same as to keep the loaded information inside the module as a variable during such request.

     

    Is it possible to keep a context that would be alive as long as the application pool is running?  For now I'm not sure if it can be done or not. If this is possible,  how can you be notified if the configuration could be modified and must refresh the context?

     

    Thank you in advance for any information on the subject.

  • 10-29-2009, 8:01 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Stored context that live longer than request state

    Based on the scope of the context, you can store it in either IHttpSite/IHttpApplication/IMetadataInfo (each of them have a IModuleContextContainer to store the context) - in each case your context will be flushed automatically in case of config change to that site/application/url and you will have to create a new one.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 10-29-2009, 10:22 PM In reply to

    Re: Stored context that live longer than request state

     Thanks Anil. I will try it out.

Page 1 of 1 (3 items)
Microsoft Communities