Created new CacheHelper which replaces the old Cache class and is accessible via the UmbracoContext. Added new CachedPartial extension method to be able to cache the output of your partials (also by page and by member) Added mew CacheHelperApplicationEventListener in order to automatically clear the partials cache when content is published, media or members is saved.
49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Umbraco.Core.ObjectResolution;
|
|
using umbraco.interfaces;
|
|
|
|
namespace Umbraco.Web
|
|
{
|
|
/// <summary>
|
|
/// A resolver to return all IApplicationEvents objects
|
|
/// </summary>
|
|
internal sealed class ApplicationEventsResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationStartupHandler>
|
|
{
|
|
|
|
/// <summary>
|
|
/// Constructor
|
|
/// </summary>
|
|
/// <param name="applicationEventHandlers"></param>
|
|
internal ApplicationEventsResolver(IEnumerable<Type> applicationEventHandlers)
|
|
: base(applicationEventHandlers)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the <see cref="IApplicationEventHandler"/> implementations.
|
|
/// </summary>
|
|
public IEnumerable<IApplicationEventHandler> ApplicationEventHandlers
|
|
{
|
|
get { return Values.OfType<IApplicationEventHandler>(); }
|
|
}
|
|
|
|
protected override bool SupportsClear
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
protected override bool SupportsInsert
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
protected override bool SupportsRemove
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
}
|
|
} |