Kyle's life in technology

Sunday, April 10, 2005

Cache item expiration in ASP.NET

Made an interesting yet painfully-learned-the-hard-way lesson tonight.

When you give an absolute or sliding expiration to Cache item, the Cache does not remove the item immediately when the expiration is reached. Rather, it will remove it on the next attempt to access the item, and return null. I would also guess that expired items are removed when Cache does a sweep when it needs to free memory.

It makes sense now that I think about it. Never thought about it before :) ouch.


Post a Comment

<< Home