Blog Post

This is Why You Need to Cache Your Base Page (Homepage)

Published
December 7, 2016
#
 mins read
By 

in this blog post

One of the most challenging aspects of optimizing web page performance while using a CDN is the handling of the base page delivery (also referred as HTML, Homepage, Landing Page). Part of the what makes this so difficult is the perceived “non-cacheability” of dynamic base pages.

Historically, the base-pages were considered to be dynamic because they changed very frequently or were unique upon every request. CDNs completely ignored this type of content in their caching strategies, only leveraging their route optimization capabilities.

But with the invasion of ajax calls, client-side logic implementation and cookie-based Javascript execution, most base-pages are common for all users and, hence, lose the mask of being unique or dynamic.

Here is a good rule of thumb for differentiating between content types:

Homepage of your favorite ecommerce website: “Dynamic” by historical definition, but the landing page is same for all users who are not logged in. Hence, it is cCacheable

Homepage of your favorite ecommerce website after logging in: The homepage is now custom to your historical buying patterns, recommendations, and suggestions. Hence, this is personalized and non-cacheable.

Unless it’s truly dynamic (contents that change on every request) or security compliance data, not caching these pages means missing out on a very simple performance optimization technique.

Catchpoint uses the “wait” metric to measure this exact event. The time from when the request is sent, to when the first packet of response data is received from the server.

Non-Cacheable Content:

cdn-cache

Cacheable Content:

cdn-caching

So if the base page is non-cacheable, this time also includes the time the CDN server takes to fetch the content from your Origin server and serve to the end-user.

Using Catchpoint’s Insight feature, we were able to monitor the performance of each web server in a webfarm for a website.

screen-shot-2016-12-07-at-2-37-25-pm

Insight provides you with visibility into end-to-end application performance and the ability to correlate external monitoring data to internal performance indicators while identifying performance problems, using custom metrics based on the information passed through header and response content.

Using Insight, we were able to attribute the sudden drop in wait times to the website’s change in the CDN caching policy.

The wait times were slashed by over 96% by enabling base-page caching.

screen-shot-2016-12-07-at-2-38-01-pm

Using Tracepoint (a custom metric), we captured the cacheability of the object. The wait times dropped as soon as caching was enabled (tcp_hit, tcp_mem_hit).

This had a direct impact on the render start time and the response time (time to download HTML).

Render start times improved by 25% and response times improved by over 75%.

screen-shot-2016-12-07-at-2-39-14-pm

screen-shot-2016-12-07-at-2-39-56-pm

Moral of the story: Cache the base page. Even if the page changes at a frequent interval, cache it. Caching pages for TTLs of as low as 1 minute will improve the response times significantly and greatly offload origin traffic.

One of the most challenging aspects of optimizing web page performance while using a CDN is the handling of the base page delivery (also referred as HTML, Homepage, Landing Page). Part of the what makes this so difficult is the perceived “non-cacheability” of dynamic base pages.

Historically, the base-pages were considered to be dynamic because they changed very frequently or were unique upon every request. CDNs completely ignored this type of content in their caching strategies, only leveraging their route optimization capabilities.

But with the invasion of ajax calls, client-side logic implementation and cookie-based Javascript execution, most base-pages are common for all users and, hence, lose the mask of being unique or dynamic.

Here is a good rule of thumb for differentiating between content types:

Homepage of your favorite ecommerce website: “Dynamic” by historical definition, but the landing page is same for all users who are not logged in. Hence, it is cCacheable

Homepage of your favorite ecommerce website after logging in: The homepage is now custom to your historical buying patterns, recommendations, and suggestions. Hence, this is personalized and non-cacheable.

Unless it’s truly dynamic (contents that change on every request) or security compliance data, not caching these pages means missing out on a very simple performance optimization technique.

Catchpoint uses the “wait” metric to measure this exact event. The time from when the request is sent, to when the first packet of response data is received from the server.

Non-Cacheable Content:

cdn-cache

Cacheable Content:

cdn-caching

So if the base page is non-cacheable, this time also includes the time the CDN server takes to fetch the content from your Origin server and serve to the end-user.

Using Catchpoint’s Insight feature, we were able to monitor the performance of each web server in a webfarm for a website.

screen-shot-2016-12-07-at-2-37-25-pm

Insight provides you with visibility into end-to-end application performance and the ability to correlate external monitoring data to internal performance indicators while identifying performance problems, using custom metrics based on the information passed through header and response content.

Using Insight, we were able to attribute the sudden drop in wait times to the website’s change in the CDN caching policy.

The wait times were slashed by over 96% by enabling base-page caching.

screen-shot-2016-12-07-at-2-38-01-pm

Using Tracepoint (a custom metric), we captured the cacheability of the object. The wait times dropped as soon as caching was enabled (tcp_hit, tcp_mem_hit).

This had a direct impact on the render start time and the response time (time to download HTML).

Render start times improved by 25% and response times improved by over 75%.

screen-shot-2016-12-07-at-2-39-14-pm

screen-shot-2016-12-07-at-2-39-56-pm

Moral of the story: Cache the base page. Even if the page changes at a frequent interval, cache it. Caching pages for TTLs of as low as 1 minute will improve the response times significantly and greatly offload origin traffic.

This is some text inside of a div block.

You might also like

Blog post

When SSL Issues aren’t just about SSL: A deep dive into the TIBCO Mashery outage

Blog post

Preparing for the unexpected: Lessons from the AJIO and Jio Outage

Blog post

The Need for Speed: Highlights from IBM and Catchpoint’s Global DNS Performance Study