Cache a User Control?

  • Thread starter Thread starter DDK
  • Start date Start date
D

DDK

I am wondering how to go about caching a User Control for a set period of 24
hours starting at a certain time like 3am and lasting til 3am the following
day. I know you can put the Output cache directive in the User Control
but I need the cache to be permanent, and I don't think you can make it
permanent with the Output cache. Or can you? The User control has a
datalist on it using a Sql Server database. So basically I just need to
find out how to go about caching the User Control or the database query for
24 hours.

Any info on how you might go about caching the User Control or query would
be much appreciated.

If you have any links on the subject that might be helpful, that would be
great too!

Thanks in advance,
D.
 
Hi,

The cache object can get as parameter a callback function that will be
call when the added object expired. You can use this callback function
to refill the data in the cache.

Look at [1] for farther details and sample code.

[1] - http://www.developersdex.com/gurus/code/653.asp

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
Back
Top