Web.PublishedCache - IPublishedCaches creates contextual caches
This commit is contained in:
@@ -20,5 +20,19 @@ namespace Umbraco.Web.PublishedCache
|
|||||||
/// Gets the media cache.
|
/// Gets the media cache.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IPublishedMediaCache MediaCache { get; }
|
IPublishedMediaCache MediaCache { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a contextual content cache for a specified context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <returns>A new contextual content cache for the specified context.</returns>
|
||||||
|
ContextualPublishedContentCache CreateContextualContentCache(UmbracoContext context);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a contextual media cache for a specified context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <returns>A new contextual media cache for the specified context.</returns>
|
||||||
|
ContextualPublishedMediaCache CreateContextualMediaCache(UmbracoContext context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,5 +25,25 @@
|
|||||||
/// Gets the media cache.
|
/// Gets the media cache.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IPublishedMediaCache MediaCache { get; private set; }
|
public IPublishedMediaCache MediaCache { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a contextual content cache for a specified context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <returns>A new contextual content cache for the specified context.</returns>
|
||||||
|
public ContextualPublishedContentCache CreateContextualContentCache(UmbracoContext context)
|
||||||
|
{
|
||||||
|
return new ContextualPublishedContentCache(ContentCache, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a contextual media cache for a specified context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <returns>A new contextual media cache for the specified context.</returns>
|
||||||
|
public ContextualPublishedMediaCache CreateContextualMediaCache(UmbracoContext context)
|
||||||
|
{
|
||||||
|
return new ContextualPublishedMediaCache(MediaCache, context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ namespace Umbraco.Web
|
|||||||
Application = applicationContext;
|
Application = applicationContext;
|
||||||
Security = new WebSecurity();
|
Security = new WebSecurity();
|
||||||
|
|
||||||
ContentCache = new ContextualPublishedContentCache(publishedCaches.ContentCache, this);
|
ContentCache = publishedCaches.CreateContextualContentCache(this);
|
||||||
MediaCache = new ContextualPublishedMediaCache(publishedCaches.MediaCache, this);
|
MediaCache = publishedCaches.CreateContextualMediaCache(this);
|
||||||
InPreviewMode = preview ?? DetectInPreviewModeFromRequest();
|
InPreviewMode = preview ?? DetectInPreviewModeFromRequest();
|
||||||
|
|
||||||
// set the urls...
|
// set the urls...
|
||||||
|
|||||||
Reference in New Issue
Block a user