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.
By default, the output cache web service is disabled. To enable and configure it, follow these steps:
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.
To use this method, you need to specify Content-Type: application/json in the headers of your REST call.
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.
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important