Simple .Net Caching with Removed Item Event Handler

This is a very simple class that allows you to Add / Remove and Get items from the .Net Cache. It exposes an event “OnCacheItemRemoved” which will be trigged in the event that something is removed from the cache either by manual means or by expiry.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Collections;

namespace Caching {

    public delegate void CacheItemRemovedEventHandler(string key, object value, CacheItemRemovedReason item);

    public class Caching {
        #region Events and Procedures
        
        public static event CacheItemRemovedEventHandler OnCacheItemRemoved;
        private static void CacheItemRemovedProxy(string key, object value, CacheItemRemovedReason item) {
            OnCacheItemRemoved(key, value, item);
        }
        
        #endregion

        #region Add To Cache

        public static void AddOrUpdate(string key, object value) {
            AddCacheItem(key, value, TimeSpan.FromDays(7));
        }

        public static void AddOrUpdate(string key, object value, TimeSpan SlidingExpiry) {
            AddCacheItem(key, value, SlidingExpiry);
        }

        private static void AddCacheItem(string key, object value, TimeSpan SlidingExpiry) {
            if (!Exists(key) && value != null) {
                HttpRuntime.Cache.Insert(key, value, null, System.Web.Caching.Cache.NoAbsoluteExpiration, SlidingExpiry, System.Web.Caching.CacheItemPriority.Default, new CacheItemRemovedCallback(CacheItemRemovedProxy));
            } else {
                Remove(key);
                HttpRuntime.Cache.Insert(key, value, null, System.Web.Caching.Cache.NoAbsoluteExpiration, SlidingExpiry, System.Web.Caching.CacheItemPriority.Default, new CacheItemRemovedCallback(CacheItemRemovedProxy));
            }
        }
        #endregion

        #region Get Item From Cache

        public static T Get<T>(string key) {
            if (Exists(key)) {
                object tmp = HttpRuntime.Cache.Get(key);
                if (tmp != null) {
                    return (T)Convert.ChangeType(tmp, typeof(T));
                } else {
                    return default(T);
                }
            }
            return default(T);
        }

        #endregion

        #region Cache Item Removal
        
        public static  bool Remove(string key) {
            if (Exists(key)){
                HttpRuntime.Cache.Remove(key);
                return true;
            }
            return false;
        }

        public static void RemoveAll() {
            IDictionaryEnumerator enumerator = HttpRuntime.Cache.GetEnumerator();
            while (enumerator.MoveNext()) {
                Remove(enumerator.Key.ToString());
            }
        }

        #endregion

        #region Cache Utility Methods
        public static  bool Exists(string key) {
            if (HttpRuntime.Cache.Get(key) != null) {
                return true;
            } else {
                return false;
            }
        }
        #endregion
    }
}