Home › Articles › Reading

January 1, 2021

Understanding CDN and Akamai Architecture

When designing an enterprise Digital Experience Platform, one of the major challenges is delivering content to customers across different geographical locations without compromising performance, security or availability.

This is where a Content Delivery Network (CDN) plays an important role.

Instead of every request reaching the origin server, a CDN distributes content through geographically distributed edge servers, reducing latency and the load on backend infrastructure.

What is Akamai?

Akamai is a distributed edge platform that provides content delivery, application performance optimization and security capabilities.

In an enterprise DXP implementation, Akamai can sit in front of the website or application, handling incoming requests before they reach the origin infrastructure.

High-level Akamai architecture

Conceptual Akamai integration with a headless DXP. Security capabilities depend on the configured products and policies.

How does a CDN work?

  1. A customer accesses the website.

  2. DNS directs the request towards the CDN infrastructure.

  3. The edge server evaluates the request and applicable security and caching policies.

  4. If a valid cached response exists, the edge server returns it directly.

  5. Otherwise, the CDN retrieves the response from the origin infrastructure.

  6. Eligible responses are cached for subsequent requests.

Two important terms here are cache hit and cache miss.

Cache hit

Response served directly from the edge cache.

Cache miss

Response retrieved from upstream infrastructure.

Important Akamai components

Component

Responsibility

Edge Servers

Deliver cached content closer to users

Property Manager

Configure routing, caching and delivery rules

Origin Server

Hosts the original application or content

Fast Purge

Invalidates or removes cached content

App & API Protector

Protects applications and APIs

EdgeWorkers

Executes custom logic at the edge

Edge DNS

Provides authoritative DNS services

Integrating Akamai with Sitecore

Consider a Sitecore headless implementation using Next.js.

The integration typically involves:

  • Configuring the website hostname and DNS.

  • Defining the Next.js application as the origin.

  • Configuring TLS certificates.

  • Establishing caching policies for different content types.

  • Excluding authenticated and personalized responses from shared caching.

  • Integrating content publishing with cache invalidation.

  • Configuring security policies and monitoring.

Akamai's Property Manager allows architects to configure caching duration, cache keys and whether origin caching headers should be respected.

Defining a caching strategy

The following is an illustrative caching policy. Actual values depend on business requirements.

Content type

Recommended policy

CSS and versioned JavaScript

Long TTL

Public images

Long TTL

Public website pages

5–15 minutes, with invalidation

Frequently changing content

Short TTL

Personalized pages

Bypass shared cache

Authenticated APIs

No shared caching

Sitecore editing and preview

Bypass cache

TTL (Time to Live) determines how long cached content remains fresh before revalidation or retrieval is required.

Akamai cache invalidation

Akamai Fast Purge supports two approaches:

  • Invalidate: Marks cached content as stale and allows revalidation against the origin.

  • Delete: Removes the cached object, requiring fresh retrieval from the origin.

Invalidation generally reduces unnecessary origin traffic compared with deletion.

Architect's takeaway

Implementing a CDN is not simply about caching static resources. It requires balancing content freshness, performance, security, personalization and origin availability.

A poorly designed caching strategy can introduce serious issues even when the underlying CDN platform is working correctly.

No comments:

Post a Comment