Caching and Content Delivery Flashcards

1
Q

Steps to create a CDN resource

A
  • Name
  • Subscription
  • Resource Group
  • Select Pricing Tier (Standard, Premium)
  • Endpoint Name
  • Orign Type
  • Origin Name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is CDN and what are some of the benefits?

A
  • Global distrubtion network
  • Reduce asset load times
  • Reduce hosting bandwidth costs
  • Increase availabitlity and redundancy
  • Protection from denial-of-service attaches
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Content Types

A

Static
* Images
* CSS
* JS Files

Dynamic Content
* Changes or user interaction
* Dashboards
* Query Results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the default Time To Live if none is specified?

A

7 Days is the default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 4 CDN products?

A
  • Azure CDN Standard (Verizon)
  • Azure CDN Standard (Akamai)
  • Azure CDN (Microsoft)
  • Azure CDN Premium (Verizon)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 3 caching rules?

A
  • Global
  • Custom
  • Query String
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the features of the Global rule?

A
  • Only one per CDN endpoint
  • Overrides cache headers sent by client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the features of a Custom rule?

A
  • Can create as many as you want
  • Can be on extension type or path in your application
  • Are applied in order
  • They override ANY global caching rules that you may have defined
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the features of the Query String rule?

A

Ignore Query Strings
* The first request goes to origin service if doesn’t exist in CDN
* Returns the results and caches the results on CDN
* Any add’l requests for that asset are served from the CDN and ignores the query string until the expiration

Bypass Query String
* No caching

Cache Every Unique URL
* Each is treated as a unique asset with its own cache AND OWN TIME TO LIVE
* Shouldn’t really use this mode if you have query strings that change with every request (low hit ratio and bad performance)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the 4 caching behaviors for Global?

A

By Pass Cache
* Not cached al all even if cache headers are sent

Override
* Override the cache headers settings setting a default cache duration for all items

Set if Missing
* Apply a custom time to live if the cache control header hasn’t been set by the requesting client

Not Set
* Which will honor any cache control headers that have been set, but won’t change the TTL value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Under the custom caching, what are the fields you need to set values for?

A
  • Match Condition
  • Match value(s)
  • Caching Behavior
  • Days
  • Hours
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Redis Cache

A
  • Operates like an in-memory database
  • Can work as a database cache
  • Event a message broker
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 5 pricing tiers for Redis Cache?

A
  • Basic
  • Standard
  • Premium
  • Enterprise
  • Enterprise Flash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Redis Cache

What are the features of the Basic pricing tier?

A
  • Supports less throughput and has high latecy
  • No SLA
  • Should not be used in a PRODUCTION environment
  • Upt to 53GB of memory and 20,000 connected clients
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Redis Cache

What are the features of the Standard pricing tier?

A
  • 2 replicated nodes
  • 99.9% availability
  • 53 GB of memory and 20,000 connected clients
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Redis Cache

What are the features of the Premium pricing tier?

A
  • Redis cluster
  • Enterpise-grade
  • High throughput and low latecy
  • 99.95% availability
  • 100 GB and 40,000 connected clients
17
Q

Redis Cache

What are the features of the Enterprise pricing tier?

A
  • Full Redis feature set
  • 99.99% availability
  • Designed for massive yet cost-effective cache implementations
18
Q

Redis Cache

What are the features of the Enterprise Flash pricing tier?

A
  • Same features as Enterpreise but has the addition of fast, novolatile flash storage
19
Q

Redis Cache

Scaling

A

Can always scale up but can never scale down

20
Q

Important

For the exam that you understand how caching policy can have on the performance and itegrity of an application. Things to consider are…

A
  • Improve performances and scalability
  • Move frequency accessed data closer to the application
  • Faster response times
21
Q

Redis Cache

When should we cache

A
  • When an application is repeatedly reading the same data
  • Data source performance (database)
  • Data contention
  • Physical Location of the Data (other region or on-premises)
22
Q

What are some of the principals when considering managing lifetime in Redish Cache?

A
  • There is no default expiration and must be set manually
  • Ratge of change of the underlying data
  • Shorter expiry for volatile data
  • Risk of outdated data
  • Lower TTL to match data change
  • Even if your caching is for seconds or minutes, you can greatly improve the performance of your application for frequenty access data
23
Q

Redis Cache

Provide an example of setting a cache value

A

client.StringSet(“Key”, “Value”, new TimeSpan(3,0,0));

The above example is set for 3 hours

24
Q

Azure Redis Cache Best Practices

A
  • Watch for data loss
  • We typically use in between our application and the primary source of data
  • Always set the expiry time
  • Keys that are created with no TTL can live forever but Redis Cache could remove them if running out of memory
  • Add Jitter to spread database loads (Don’t what all cache items to expire at the same time)
  • Avoid caching large objects and consider breaking them down into smaller objects (Storing large objects can lead to timeouts)
  • Redish cache MUST be in the same region as your application
25
Q

What are the benefits of caching

A

Scalability and resilience

26
Q

What are some of the Caching Patterns?

A
  • Cache-asign Pattern
  • Content Cache Pattern
  • User Session Caching Pattern
  • Advanced Patterns such as Job And Message Queuing
27
Q

Explain the Cache-assign pattern

A

Does the data exist in the cache?
If not retrieve from the data store
Store the new copy in the cache

28
Q

Explain the Content Cache Pattern

A

Cache static content such as Images, Templates, and Style Sheets

29
Q

Explain the User Session Caching Pattern

A

An example would be storing shopping cart data for a user for the session

Can use cookies ofr Local Storage but limited on the amount of data these options can have and is slower

30
Q

Explain the Advance Pattern, Job and Messaing Queuing Pattern

A

Offload longer running taskes into queues that can run in sequence

31
Q

Important - Configuring and optimizing Redish Cache on Exam

What are some considerations for provisioning the right Redis Cache

A
  • Number of concurrent cache objects
  • Size of the cache objects
  • Number of requests to cache
  • Standard C3 tier => 100,000 request a second but drops to 90,000 over an SSL connection
  • Cache expiration policy

Do not want to overprovision!
Redis Cache Benchmark Utility (Cannot run on Portal)
Redis-benchmark -q -n 100000

32
Q

Identity and briefly explain the two retry policies in Redis Cache

A

Linear Retry
* Specify a retry duration (i.e. 5 seconds)

Exponential Retry
* Retry durations increases with each subsequent attempt
* Radom values being chosen between deltaBackoff and maxDeltaBackoff

33
Q

What are some consideration regarding security in Redis Cache and options for securing

A

Encryption in Transit
* Uses TLS 1.2
* TLS 1.1 supported for compatibility
* Redis can support HTTP but not recommended for production. Is disabled by default

Encryption at Rest
* In memory data IS NOT ENCRYPTED or not supported in Azure
* Premium tiers does allow backup to Storage Accounts but data can be encrypted there

Note: If you disable HTTPS to allow HTTP, you need to change the Primary and Secondary connection string PORT numbers. Default for HTTPS is 6380.