示例#1
0
        /// <summary>
        /// cacheEntry 要素を更新します
        /// </summary>
        /// <param name="cacheControl"></param>
        /// <param name="cacheEntry"></param>
        public static void UpdateEntry(CacheControlHeaderValue cacheControl,
            CacheEntry cacheEntry)
        {
            Contract.Requires(cacheControl!=null);
            Contract.Requires(cacheEntry!=null);

            if(CacheProvider==null) return;

            if (cacheControl.NoCache)
            {
                CacheProvider.RemoveEntry(cacheEntry.RequestUri);
            }
            else
            {
                cacheEntry.ExpireAt = DateTime.UtcNow.Add(cacheControl.MaxAge ?? TimeSpan.FromSeconds(60));
                CacheProvider.UpdateEntry(cacheEntry);
            }
        }
 public void UpdateEntry(CacheEntry cacheEntry)
 {
     Contract.Requires(cacheEntry!=null);
 }