Sitefinity CMS output cache implementation guarantees that your sites perform optimally and can handle peaks in user load. Using distributed output cache enhances this effect further, because items, stored in output cache, remain available even during website restarts or IIS AppPool recycles.
Output cache is supported for OData services. The cache is supported only for unauthenticated, frontend requests. OData output cache works the same way as the standard output cache – it can be enabled and disabled, and it is configurable via cache profiles.
You can enable and disable OData output cache for the whole Sitefinity CMS instance. Perform the following:
Afterwards, you pass the value of the authentication key when making calls to the service. You pass it as HTTP header with key SF_OUTPUTCACHE_AUTH.
SF_OUTPUTCACHE_AUTH
IMPORTANT: The setting is important to the security. Unless, your specific use case scenario requires that you make the web service calls to the output cache web service over http://., keep this checkbox checked.
Perform the following:
Defines the programmatic name of the profile. This is the name used to access the profile.
Specifies the location of the cached HTTP response content. You can choose one of the following values:
Specifies the maximum time in seconds that the fetched response is allowed to be reused from the time of the request.
Corresponds to the max-age directive of the cache-control header. If this value is not specified, the system uses the client caching and the Duration property sets the client cache max age.
max-age
cache-control
Duration
This setting corresponds to the s-maxage cache-control directive and it explicitly applies to proxy servers.
s-maxage
The proxy max age property overrides the max-age directive and expires the header field when present.
To configure specific route:
NOTE: If the you leave the field empty, the system uses the default output cache profile.
Output cache increases your website performance. In some cases, however, you might want to have a mechanism for on-demand invalidation of distributed output cache.
For example, when the development team applies a change to a template and deploys this to production. The deployment causes an application restart and, in case of in-memory output cache, the cached HTML of the website pages is invalidated, so that the newly deployed changes become visible immediately. With distributed output cache, the application restart does not affect the output cache of pages, therefore you may not see the newly deployed changes to take effect, until you manually publish the page or template, where your widget is placed, or wait for cache to expire.
To assist in situations, where distributed output cache must be invalidated on-demand, Sitefinity CMS exposes a web service for manipulating output cache. By calling the /restapi/cache/clear endpoint, website administrators, or authorized users can effectively purge the distributed output cache.
/restapi/cache/clear
The output cache web service is available at the /restapi/cache endpoint. It supports POST requests to the service /restapi/cache/clear method. Calling the method invalidates all output cache items stored in distributed cache.
restapi/cache
POST
NOTE: Clearing all output cache items on a production website might result in a significant performance impact. Avoid doing this if your site is under heavy load.
If you have configured an Authentication key, you can pass the key as an HTTP header to the request. The header key must be SF_OUTPUTCACHE_AUTH, and its value - the Authentication key value.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important