Skip to content

Add events to the Output Cache filter in order to allow modules to extend it #5790

Description

@paynecrl97

3rd party (or even 1st party) modules are currently very restricted in the way that they can interact with the Output Cache functionality.

I propose adding an event handler interface to allow developers to hook into specific events offered by the Output Cache filter.

This could look something along the lines of this:

public interface IOutputCacheEventHandler : IEventHandler
{
    void Caching(string cacheKey, CacheItem cacheItem);
    void Cached(string cacheKey, CacheItem cacheItem);
    void Retrieving(string cacheKey);
    void Retrieved(string cacheKey, CacheItem cacheItem);
}

Example use cases would be:

  • Altering markup immediately before the item is cached (for example to remove the Glimpse console)
  • Adding additional logging or diagnostics

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions