locked
Cache and httpModules.... RRS feed

  • Question

  • User1254222884 posted
    How can I use the cache from inside an httpModule? For example, I have a few SQL tables with small amounts of data (configuration info, etc.) that I would like to keep cached in my custom httpModule so that I don't have to go to the database on every request. However, I want to be able to read the database periodically (or when the tables change) to update my cache with changes. One more specific example: Which pages in the site require login? We have a table with the ids of the pages that require login. I want to cache this information in my custom httpModule, but re-read the db every 4 hours or when the table changes (if possible). TIA,
    Thursday, February 12, 2004 1:47 PM

All replies

  • User883524816 posted
    You could set up a timer in an httpModule or Global.ascx to periodically hit your db and update the results. I build a small framework you could use for this here: http://scottwater.com/dottextsourcetree/browse.aspx?f=C:\Sites\DottextSource\Dottext.Framework\ScheduledEvents -Scott
    Wednesday, February 25, 2004 9:30 AM