I've been making some changes to a site and have noticed that when I make a change in the database, ie. add a new person value, the person's name doesn't appear in a dropdown list.
If I reset the application pool a few times the name does finally appear for me. Though doesn't always seem to for others.
It does seem to be controlled heavily by cache and I've found the following:
HttpContext.Current.Cache.Insert("PersohnList", d, Nothing,
DateTime.MaxValue, New System.TimeSpan(0, 30, 0),
Caching.CacheItemPriority.High, Nothing)
I've noticed a few values here of interest,
a) DateTime.MaxValue
b) New System.TimeSpan(0, 30, 0)
Will the cache expire after 30 mins and insert the new person's name or will it not expire because of DateTime.MaxValue.
Any ideas?
I am not certain which would win out. It seems that this code is setting the slidingExpiration and the absoluteExpiration. I would assume the latter would win in this but the MSDN documentation says that you should only use one or the other. If using the slidingExpiration, you should set the absoluteExpiration parameter to NoAbsoluteExpiration and if using the absoluteExpiration, you should set the slidingExpiration to NoSlidingExpiration.
If I were you, I would just invalidate the cache when the value is being updated
(HttpContext.Current.Cache.Remove("PersohnList")
and reset it again.