 <p>You can do something like this:</p> <pre><code> private void AddHourlyTask(string task) { DateTime expiration = DateTime.Now.AddHours(1); expiration = new DateTime(expiration.Year, expiration.Month, expiration.Day, expiration.Hour, expiration.Minute, expiration.Second, expiration.Kind); OnCacheRemove = new CacheItemRemovedCallback(CacheItemRemoved); HttpRuntime.Cache.Insert( task, task, null, expiration, Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, OnCacheRemove); } </code></pre> <p>And then in a separate function:</p> <pre><code> public void CacheItemRemoved(string k, object v, CacheItemRemovedReason r) { if (k == "HelloWorld") { Console.Write("Hello, World!"); AddHourlyTask(k); } </code></pre> <p>This would go into your Application_Start() function as:</p> <pre><code>AddHourlyTask("HelloWorld"); </code></pre> <p>In order for this to work, you also need to add this somewhere in your class:</p> <pre><code>private static CacheItemRemovedCallback OnCacheRemove = null; </code></pre> <p>The functions would all sit in your Global.asax.cs file</p>