Deliver superior customer experiences with an AI-driven platform for creating and deploying cognitive chatbots
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
Configuring output cache is very important part of the performance tuning process of your website. Sitefinity offers an easy way to configure output cache and there is a documentation article available providing detailed information about this.
When you request a Sitefinity page our PageRouteHandler class checks whether there is such a cached version of the page and serves it. If the page is not present in cache we will add it and serve it from there on the next request. By default when you try to access a page of your website using different browsers, separate output cache will be created for every browser. To recognize which browser currently requesting particular page PageRouteHandler relies on browser’s user-agent variable.
In this blog post I will demonstrate how you can change the default behavior and implement a custom page route handler that will create non-browser specific cache. To achieve this we need to create a new route handler that will inherit from PageRouteHandler. The method responsible for managing output cache is ApplyServerCache and we will need to override it in order to change its default behavior. This behavior can be modified by changing the value of UserAgent property.
As I already mentioned above we need to create a new class that will inherit from PageRouteHandler and then override ApplyServerCache method.
CustomPageRouteHandler : PageRouteHandler
ApplyServerCache(HttpContextBase context, Telerik.Sitefinity.Modules.Pages.Configuration.OutputCacheProfileElement profile, PageSiteNode siteNode)
duration = profile.Duration;
slide = profile.SlidingExpiration;
var cache = context.Response.Cache;
TimeSpan(0, 0, duration));
sender, EventArgs e)
Bootstrapper.Bootstrapped += Bootstrapper_Bootstrapped;
I have prepared and a short video illustrating how our custom page route handler is working.
You can download the complete sample from here.
View all posts from Kaloyan Savov on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.