Integrate Caching and Content Delivery Flashcards

1
Q

Basic request/response lifecycle

A

User makes request.

If the CDN (.azureedge.net) doesn’t have the file, it goes to the origin server and requests the file.

The file is cached and remains cached until the Time To Live specified in the HTTP header. If the origin server doesn’t specify, the default is 7 days.

The file gets cached in the CDN and can be used for other user requests

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

What are the 2 ways you control how your files are cached in the CDN?

A
  1. Caching rules (global or custom)

2. Query string caching

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

Azure Redis Cache is…

A

In-memory cache.

CDN is storage account in Point of Presence (POP) servers.

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

How much time does it usually take for propagation to complete for Azure CDN Standard from Akamai profiles?

A

1 minute. For Azure CDN Standard from Verizon profiles, propagation usually completes in 10 minutes.

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

What are the two types of caching rules offered by Azure CDN?

A

Global and custom.

Custom overrides global.

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

What is the difference between global and custom caching rules in Azure CDN?

A

Global: Only one per CDN endpoint. Affects all requests to the endpoint.

Custom: One or many rules allowed. Allow you to specify caching behavior for specific file or path in your app. Override global caching rule

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

What are the 4 pricing tiers in Azure CDN?

A

Azure CDN Standard from Microsoft
Azure CDN Standard from Akamai
Azure CDN Standard from Verizon
Azure CDN Premium from Verizon.

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

Describe the 4 options for global caching rules.

A

Can override HTTP headers sent by clients.
4 options:
1. Bypass Cache: no items are cached at all even if caching headers set
2. Override: override headers setting default cache duration for all items
3. Set if missing: applies a custom TTL if the cache control header has not been set by the requesting client
4. Not set: honors 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
9
Q

Explain query string caching in CDNs.

A

Define how requests that contain query strings are dealt with.

  1. Ignore them (default) : CDN passes the query string from the requesting client through to the origin server on the first request and caches the asset that’s returned. Subsequent requests ignore the query string until the cached asset expires.
  2. Bypass query string: Any requests containing query strings are not cached at all by the CDN, and asset is retrieved directly from origin server and passed directly to the client
  3. Cache every unique URL: every unique URL is treated as an asset with its own cache and its own time to live. Don’t use this mode if your URLs contain query string values that change with every request. This would result in poor performance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some common uses for Redis cache?

A

User session storage for distributed apps
Database caching (specific queries to the database)
Content caching
Distributed transactions
Message broker

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

What are some considerations you should make when determining tier of Azure Redis cache?

A

Overall cache size (amount of data stored in cache)
General network performance (low, moderate, high)
# of client connections

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

What are the 3 ways an item can be removed from Redis cache?

A
  1. TTL (scheduled deletion - “volatile item”)
  2. Manual removal using a client library
  3. Eviction (happens under memory pressure. Can’t control this). Can control the policy of how this happens.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the default eviction policy in Azure Redis cache?

A

volatile-lru (least recently used) - evaluates (and deletes) the lease recently used volatile items

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

Besides volatile-lru, what are the other eviction policy options?

A

Allkeys-lru - evaluates (and deletes) all items for lru (not just items that have a TTL)
No eviction
Volatile-random: selects at random volatile item to be removed
Allkeys-random: selects items at random from both volatile and non-volatile
Volatile-ttl: remove items with the shortest ttl remaining

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

When deciding what data to cache in Redis, what are some considerations?

A

Repeatedly accessed data (especially if it remains unchanged - this allows you to cache static and/or dynamic data if dynamic remains unchanged)

Data source performance: querying data from sql is significantly slower than retrieving from Redis cache

Data contention: if you have multiple processes within App all competing for access to the same data, then you should definitely consider that data for caching

Location of the data: if your db is on-prem or in another location, data should be considered for caching

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

True or false: Out of the box, an item in Azure Redis cache doesn’t have a TTL. It exists until it is forcefully removed.

A

True

17
Q

What are 2 guiding principles when determining the cache period for items in Azure Redis cache?

A

Consider rate of change of the underlying data (long expiry for static data; short expiry for volatile data)

Consider the risk of using outdated data. Lower TTL if data changes often.

18
Q

what are some common caching patterns (Redis)?

A
  1. Cache-aside: store most frequently accessed data so that it’s available without having to query the db
  2. Content cache: cache static content (kind of like CDN)
  3. User session (store in Redis instead of session cookie or local storage)
  4. Job and message queuing
  5. Distributed transactions (everything must complete for the transaction to move forward)
19
Q

What factors would you use to estimate Redis cache size?

A
  1. # of co-existing objects you’ll have
  2. Size of cached objects
  3. Number of cached requests your app will make to the cache. Standard C3 tier of Redis Cache can process 100,000 requests/second. Drops to 90,000 requests/sec over SSL.
  4. Cache expiration policy. If items expire too quickly, they won’t be available when they’re required.
20
Q

True or false: the Redis benchmark utility is available through the Azure portal

A

False. It’s available through the Redis CLI. Allows you to simulate load on your Redis instance.

21
Q

Dynamic site acceleration is a CDN optimization method that is available, and utilizes what Microsoft service?

A

Azure Front Door Service

22
Q
Which of the following services must be used to control how files are cached for a web request that contains a query string?
Odata
Redis
Front Door
None
A

Front Door

23
Q

If you want to automate the creation and management of CDN profiles and endpoints which of the following services is most appropriate to be used?

A

Azure CDN Library for .NET

24
Q

Files that are cached before a rule change maintain their origin cache duration setting. To reset their cache duration you must purge the file.

A

True

25
Q

The blank blade provides a mechanism for linking two Premier tier Azure Cache for Redis instances.

A

Geo-Replication

26
Q

In regards to Azure Cache, Azure Redis currently has 10 minute idle timeout for connections, so what value should the idle timeout be set to?

A

Less than ten minutes

27
Q

To connect to an Azure Cache for Redis instance, cache clients need the host name, ports, and a what for the cache.

A

Key