The Sitefinity CMS output cache implementation guarantees your sites perform optimally and can handle peaks in user load. When you use distributed output cache, the items, stored in the output cache, remain available even during website restart or IIS AppPool recycle. For more information, see Distributed output cache
The above described behavior is beneficial for your website performance and is one of the main advantages of distributed output cache. In some cases, however, you might want to have a mechanism for on-demand invalidation of distributed output cache. Let's take, for example, a case when you apply a change to an MVC view or template, and deploy this on production. The deployment causes an application restart, and in the case of in-memory output cache, the cached HTML of the website pages is invalidated, thus the newly deployed changes will become visible immediately. With distributed output cache, the application restart does not affect the output cache of pages, thus you might not see the newly deployed changes take effect until you manually publish the page or template, where your widget is placed, or wait for cache to expire naturally.
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
By default, the output cache web service is disabled. To enable and configure it, follow these steps:
SF_OUTPUTCACHE_AUTH
https://
http://
The output cache web service is available at the /restapi/cache endpoint. It supports only POST requests to the service /restapi/cache/clear method. Calling the method effectively invalidates all output cache items stored in distributed cache.
/restapi/cache
To use this method, you need to specify Content-Type: application/json in the headers of your REST call.
Content-Type: application/json
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.
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.
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