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,
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
ojm37
Contributor
2248 Points
832 Posts
Cache and httpModules....
Feb 12, 2004 05:47 PM|LINK
ScottW
Contributor
3651 Points
730 Posts
ASPInsiders
Re: Cache and httpModules....
Feb 25, 2004 01:30 PM|LINK
http://www.scottw.com