Beispiel #1
0
        /// <summary>
        /// Invalidates the current record from the cache.
        /// </summary>
        /// <param name="record">The record</param>
        public void InvalidateRecord(Page record)
        {
            if (Cache.ContainsKey(record.Id))
            {
                Cache.Remove(record.Id);
            }
            // If we click save & publish right away the permalink is not created yet.
            if (record.Permalink != null && PermalinkCache.ContainsKey(record.Permalink))
            {
                PermalinkCache.Remove(record.Permalink);
            }
            if (record.Permalink != null && PermalinkIdCache.ContainsKey(record.PermalinkId))
            {
                PermalinkIdCache.Remove(record.PermalinkId);
            }
            if (record.IsStartpage && Cache.ContainsKey(Guid.Empty))
            {
                Cache.Remove(Guid.Empty);
            }

            // Invalidate public sitemap
            if (!record.IsDraft)
            {
                Sitemap.InvalidateCache();
            }
        }