Distributed Page Output Caching & CDN

Overview

Output caching stores a rendered page and spits back the stored HTML instead of
having to generate it again for each request. On the first request, the output is cached,
subsequent requests for the set duration use the cached page instead of generating the
html again. If the page is database intensive, then all subsequent requests should be
much faster as it won’t make any database calls or server intensive processing.

By default, the content will be cached on the webserver memory. The cached version of
the page will be stored as InProc and will be affected by any changes to the IIS process.
For example, the cache will be invalidated when app pool crashes or restart on schedule.

Distributed Page Output Caching

Distributed Page Output Caching is a game-changer, as it moves the cache away from the web server, ensuring that it remains unaffected by server processes through decentralizing the cache store. The cache can be configured to store outside and won’t be affected by
IIS process. Also, in a load balanced environment only the first request from one of the
webserver will need to fetch the page from database. All subsequent request from any
of the webserver will fetch from the centralized cache.

  • Decreased CPU and Memory utilization on the web server nodes.
  • Cache availability after worker process restart
  • Bringing up an additional node does not require warmup, as it can serve
    items that are available in distributed cache storage. (“InMemory and
    Distributed output cache comparison”)
  • The cost of spinning up a new node is no longer linear as only the first node
    that gets hit with a request for non-cached content does the heavy lifting.

In-memory Cache

Distributed Cache

Startup time (first node)

Web server node processes
the content and stores an
output cache item in its
memory.

Web server node processes
the content and stores an
output cache item in the
distributed cache.

(“InMemory and
Distributed output cache
comparison”)

  • *Startup time (subsequent
    nodes)**

"New web server nodes compile and processes the
content and store an output cache item in their memory."

(“InMemory and
Distributed output cache
comparison”)

Startup time
is the same as first node

New nodes get the item
from the distributed cache.

Startup time is up to 5
times faster.

CPU utilization

"Each web server node
uses CPU resources to
processes the content and stores an output cache
item."

(“InMemory and Distributed output cache
comparison”)

Only the first web server
node uses CPU resources
to processes the content.

Memory consumption

Each web server node consumes memory to stores an output cache
item.

No memory is used to
store output cache items
on the web server nodes.

Availability

"Output cache items are
persisted in the server memory and are not available after restart."

(“InMemory and
Distributed output cache comparison")

Output cache items remain
on the distributed cache storage and remain available after web server
node restarts.

CDN

Images will be stored in Amazon S3 and served through Cloudfront. Cloudfront is built
for high performance and will reduce latency by delivering data through globally
dispersed Point of Presence (PoPs)
with automated network mapping and intelligent
routing. This solution is focused on speed and getting data to you quickly from locations all around the world.