Cloudflare Cache Reserve Walkthrough and Demo

Cloudflare
24 Mar 202309:49

Q & A

  • What is the primary focus of the video presented by Humir Ahmed?

    -The video focuses on Cloudflare's Cash Reserve feature, including a brief discussion on the basics of Cloudflare CDN and a demo of Cash Reserve.

  • How can users onboard onto Cloudflare CDN?

    -Users can onboard by clicking 'add site' on the dashboard, entering their domain, and Cloudflare will automatically import DNS records. Users are then given Cloudflare name servers to change their authoritative DNS.

  • What is the alternative to changing the primary authoritative DNS for using Cloudflare CDN?

    -Users can still use Cloudflare CDN without changing their primary authoritative DNS by doing a partial CNAME setup.

  • What happens when an HTTP request matches a cachable file extension in Cloudflare CDN?

    -If the request matches a cachable extension, Cloudflare serves the resource from cache if present. Otherwise, it fetches from the origin to fill the cache and then serves the response to the client.

  • What is Cloudflare's Tiered Cache and how does it function?

    -Cloudflare's Tiered Cache divides its global data centers into upper and lower tiers. Only upper tiers request content from the origin, distributing it to lower tiers, thereby improving bandwidth efficiency and reducing origin load.

  • What triggers a cache miss in Cloudflare CDN?

    -A cache miss occurs due to intentional actions like cache TTL expiration or content purging, or unintentional actions like purging based on the Least Recently Used (LRU) algorithm.

  • What is Cloudflare's Cash Reserve, and how does it enhance cache hit ratio?

    -Cloudflare's Cash Reserve stores all cachable files in persistent object storage buckets. It acts as an ultimate upper tier, checking storage buckets before going to the origin during a cache miss, thereby increasing cache hit ratio.

  • How does Cash Reserve impact traffic flow and origin server load?

    -Cash Reserve minimizes the need to pull content from the origin by checking storage buckets during a cache miss, reducing unnecessary egress fees and decreasing load on the origin server.

  • How did the Cash Reserve feature affect the cache hit ratio in the demo?

    -After enabling Cash Reserve, the cache hit ratio improved significantly, reaching over 90% from a previous 80%, moving closer to a 100% cache hit ratio.

  • How can users manage and monitor their use of Cloudflare's Cash Reserve?

    -Users can view data stored in Cash Reserve, aggregate storage used, and read/write operations from the Cloudflare dashboard. They can also pause Cash Reserve, purge cache content, and create page rules for specific caching behaviors.

Mindmap

Highlights

Introduction to Cloudflare Cash Reserve with a brief overview of Cloudflare CDN basics.

Easy onboarding process onto Cloudflare CDN described.

Explanation of the basic traffic flow in Cloudflare CDN, including cacheable file extension matching.

Introduction of Cloudflare's Tiered Cache and its benefits like improved bandwidth efficiency.

Explanation of how Cloudflare's Smart Tiered Cache Topology works for content distribution.

Discussion on cache misses scenarios and their causes.

Introduction of Cloudflare Cash Reserve to increase cache hit ratio by storing all cacheable files.

Details on how Cash Reserve acts as an ultimate upper tier in Cloudflare's caching strategy.

Demonstration setup explained with a large image and video gallery hosted on a third-party cloud.

Cloudflare dashboard walkthrough showing Cash Reserve features and stats.

Explanation of Cash Reserve's role in improving cache hit ratio from 80% to over 90%.

Insight into Cloudflare's caching details, including most popular content types.

Page rules creation for more granular caching behavior control.

Overview of cash rules for overriding TTL settings directly at the edge.

Demonstration of log push setup and including the Cash Reserve used field for better visibility.

Transcripts

play00:00

hello my name is humir Ahmed and in this

play00:02

video I'm going to walk through Cloud

play00:03

for cash reserve and follow up with demo

play00:06

I will very briefly discuss some Basics

play00:08

from cloud for CDN before getting right

play00:10

into Cash Reserve to provide a better

play00:12

grasp of how everything fits together

play00:14

however I'll keep this very minimal so I

play00:16

can focus on cash Reserve for more

play00:19

thorough understanding of cloud

play00:20

vercidian in general and how it works

play00:22

please see the cloud for CDN reference

play00:24

architecture in the prior video I did on

play00:26

cloudflare CDN walkthrough with that

play00:29

let's get going

play00:31

first let's talk about how easily you

play00:33

can get started and onboarded onto

play00:34

cloudflare CDN

play00:36

from the dashboard simply click add site

play00:38

and enter your domain cloud4 can

play00:41

automatically import your DNS records

play00:43

from your existing DNS provider and

play00:46

finally you're given Cloud for name

play00:47

servers you can use to change your

play00:49

authoritative DNS so here you're using

play00:51

cloudford's DNS Azure authoritative DNS

play00:54

and also onboarded onto cloudflare CDN

play00:58

now if you don't want to change your

play01:00

primary or authoritative DNS you can

play01:02

still use cloudflare CDN by simply doing

play01:05

a partial cname setup so lots of

play01:07

flexibility there

play01:10

so if we look at the very basics of the

play01:12

traffic flow now first HTTP request is

play01:15

made closest data center to user handles

play01:19

the request users HTTP request URL is

play01:22

matched against the list of cachable

play01:24

file extensions if the request matches

play01:27

an extension on the list Cloud first

play01:28

serves the resource from Cache if

play01:30

present

play01:31

second content is fetched from Cache or

play01:34

origin cloudflare examines its caches in

play01:37

multiple Network locations for content

play01:39

and serves it if present if the content

play01:42

is still in Quad verse cache cloudfare

play01:44

attempts to revalidate the content with

play01:45

the origin before serving the response

play01:47

to the client if the resource is not

play01:50

present in the cache Cloud Fair requests

play01:52

the resource from the origin to fill the

play01:53

cache and the response is then sent to

play01:55

the client who initiated the request

play01:59

if cachable content is cached on the

play02:01

response so cloudflare's cash logic

play02:04

examines the HTTP response received from

play02:07

the origin the response is either deemed

play02:09

cachable and written to disk for use

play02:10

with the next request for the same

play02:12

resource or the request is deemed

play02:14

uncashable

play02:17

now let's take a look at the traffic

play02:19

flow with Cloud Fair tiered cache with

play02:21

smart tiered cache topology enabled as a

play02:24

reminder tiered cash divides

play02:26

cloudflare's network of global data

play02:28

centers into a hierarchy of upper tiers

play02:30

and lower tiers and in order to control

play02:32

bandwidth number of connections between

play02:34

an origin and cloudflare only upper

play02:37

tiers are permitted to request content

play02:39

from an origin and are responsible for

play02:41

Distributing information to the lower

play02:43

tiers smart tiered cash topology is the

play02:46

default topology and available for free

play02:48

for all plans this is also recommended

play02:50

for most deployments instructing

play02:52

cloudflare to find the single best upper

play02:54

tiers for your Origins

play02:56

benefits here include improved bandwidth

play02:59

efficiency reduced origin load and

play03:01

making websites more cost effective to

play03:03

operate

play03:04

so when client one sends a request to

play03:06

the closest data center data center one

play03:08

here

play03:09

if the content is not cached the upper

play03:11

tier data center label data center 3

play03:13

here is checked if the content is not

play03:16

cached at the upper tier the upper tier

play03:17

requests the content from the origin

play03:19

once their sponsors returned from the

play03:22

origin the upper tier caches it and

play03:24

returns a response to the lower tier

play03:25

which also caches it and returns a

play03:28

response to the client

play03:30

now let's say client 2 makes the same

play03:32

request for the same content to its

play03:34

closest data center data center too

play03:37

if the content is not cached to Data

play03:39

Center too similar to Prior the upper

play03:41

tier data center is checked however in

play03:44

this case content was requested prior

play03:46

via client 1 and the upper tier data

play03:48

center has the content cached and

play03:50

Returns the cache content to the lower

play03:52

tier data center data center 2 which in

play03:55

turn caches the content and responds

play03:57

back to the client decreasing latency

play03:59

saving bandwidth and load on the server

play04:01

and providing better overall performance

play04:05

so now that we have a better

play04:07

understanding of cloud for CDN when does

play04:09

a cache Miss occur well we have two

play04:11

scenarios first intentional cash TTL

play04:15

expired or content purged customers set

play04:18

cache control time to signify when the

play04:20

content is out of date and needs to be

play04:22

revalidated once expired content needs

play04:25

to be revalidated and may need to be

play04:27

pulled from the origin if updated

play04:28

version exists customers can Purge

play04:31

content manually at any time

play04:33

second unintentional cloudflare Purge

play04:36

content due to lru or least recently

play04:38

used algorithm to optimize storage less

play04:41

frequently accessed content may be

play04:43

purged based on lru or how long the

play04:45

network wants content to remain cached

play04:48

now this is where Cloud for cash Reserve

play04:51

can be useful to further increase cash

play04:53

hit ratio by automatically storing all

play04:56

cachable files into cloudflare's

play04:58

persistent object storage buckets

play05:01

basically cash Reserve acts like an

play05:03

ultimate upper tier and when there's a

play05:05

cash Miss cloudflare will first check

play05:07

these storage buckets before going to

play05:09

the origin you can see here I've enabled

play05:12

it and I'll walk through this more in

play05:14

the demo

play05:15

so let's look at the traffic flow now

play05:18

again when the client sends a request to

play05:20

the lower tier data center if the

play05:22

content is not cached the upper tier

play05:24

data center is checked this time however

play05:26

if the content is not cached at the

play05:28

upper tier the upper tier checks cash

play05:30

Reserve instead of requesting straight

play05:32

from the origin

play05:33

if the content is not present in cash

play05:35

Reserve cash Reserve will request it

play05:37

from the origin once response is

play05:40

returned from the origin cash Reserve

play05:41

caches the content while replying to the

play05:44

upper tier which also caches it and

play05:46

Returns the response to the lower tier

play05:48

which also caches it and responds to the

play05:50

client now next time the same content is

play05:53

requested if there is a cache Miss at

play05:55

the lower tier data center the upper

play05:57

tier data center is checked now if

play05:59

there's say cache missed at the upper

play06:01

tier data center let's say expired TTL

play06:03

or content has been evicted cash Reserve

play06:06

will be checked and if content exists at

play06:08

Cash reserve it will be returned and

play06:10

cached at the upper tier before being

play06:12

returned and cashed at the lower tier

play06:14

and returned to the client so you can

play06:17

see here how cash Reserve acts as the

play06:19

ultimate upper tier and minimizes the

play06:21

need to pull from the origin decreasing

play06:23

unnecessary egress fees

play06:25

with that let's jump into the demo for

play06:28

demonstration purposes I deployed a site

play06:30

here that's basically a large image and

play06:32

video gallery for uploading and

play06:34

downloading content

play06:36

now again for demonstration purposes the

play06:39

website is actually hosted on a

play06:41

third-party Cloud I also have automated

play06:44

traffic running to simulate visitors

play06:46

accessing the site

play06:48

so now I'm going to go over and head

play06:49

over to my cloudflare dashboard and here

play06:52

you can see I have cash Reserve enabled

play06:55

and it shows the current amount of data

play06:57

stored in cash Reserve as well as the

play06:59

total aggregate storage used over the

play07:02

specific time period and you also have a

play07:04

view of total cash Reserve read and

play07:06

write operations once enabled cash

play07:09

Reserve will start caching files with a

play07:11

retention period of 30 days which will

play07:13

be reset on any hits

play07:15

customers can also pause using cash

play07:17

Reserve meaning cloudflare's network

play07:19

will no longer use cash Reserve to serve

play07:21

data

play07:22

here under overview you can see the

play07:25

overall cash status including content

play07:27

served by cloudflare and content served

play07:30

by the origin

play07:31

you can see the vast majority of

play07:33

requests are served by cloudflare and if

play07:36

you scroll down here and hover over the

play07:38

cast status you can see a

play07:41

92.96 cash hit ratio really good now

play07:45

since I just enabled cash reserve a few

play07:47

days ago if I go up here instead of 24

play07:50

hours I select previous 30 days

play07:54

we could see the cash hit ratio was

play07:56

lower at around 80 percent so cash

play07:59

Reserve really helped get into that 90

play08:01

plus ratio getting us closer and closer

play08:04

to that hundred percent

play08:06

and scrolling down here you can see more

play08:08

overall caching details in general like

play08:10

the most popular content types and what

play08:13

specific content is the most popular

play08:15

here on the left you can also Purge the

play08:17

cache which will also Purge content and

play08:19

cash reserves you can also create page

play08:21

rules to get more granular on any

play08:23

specific caching behavior let's go into

play08:26

this and take a look in more detail you

play08:28

can see I created a page rule matching

play08:31

on all requests that contain this

play08:33

specific domain name

play08:34

and I set the cache level to Cache

play08:37

everything that's cachable but also can

play08:39

select different cash level including

play08:41

bypassing cache if desired

play08:43

so now I'm gonna head over to caching

play08:45

and look at Cash rules

play08:48

so under cash rules I can also create a

play08:51

rule as I did here to override ttls from

play08:54

Cache control headers

play08:56

this is done right at the edge and you

play08:58

can see here if I click into it

play09:00

all requests to this hostname

play09:03

I've configured as content eligible for

play09:06

caching and overridden the origin TTL

play09:08

setting it to 12 hours with cloudflare

play09:11

httl it makes it very convenient to set

play09:14

TTL in one place for all assets

play09:17

now I'm going to head over to analytics

play09:19

and logs there

play09:21

and I'll go under logs you can see I've

play09:24

set up a log push I'm just going to

play09:25

click edit here

play09:27

last thing I want to show here is you

play09:29

can also log data to external logs and

play09:31

include the cash Reserve used field to

play09:34

get more visibility into requests and

play09:36

respective content being served from

play09:38

cash Reserve I hope you found this

play09:40

cloudflare cash Reserve walkthrough in

play09:42

demo informational and useful for

play09:44

additional details make sure to check

play09:45

out the cloudflare cash Reserve product

play09:47

page