-
Notifications
You must be signed in to change notification settings - Fork 1
IUpstreamOutputCache
Output caching middleware does not have to implement IUpstreamOutputCache but any full featured implementation should. Output caching middleware that implements this interface is providing a way for other downstream middleware to provide the output caching middleware with information that will make the output cache more efficient.
This interface is part of the upstream communication mechanism that allows downstream middleware to communicate back upstream before the upstream middleware processes the request.
For example presentation middleware will often know how frequently the response will change for a given request, but the output caching middleware does not know this, which severely limitshow well it can do its job. It would be possible to make the output caching middleware configurable so that it does know, but this would make application development very laborious and error prone because the application developer would have to ensure that the presentation layer and the output caching middleware configuration were always maintained in sync.
The IUpstreamOutputCache interface means that the application developer does not need to explicitly configure output caching and the output caching middleware can still be effective and efficient.