You are using Cloud CDN to deliver static HTTP(S) website content hosted on a Compute Engine instance group.
You want to improve the cache hit ratio.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
https://cloud.google.com/cdn/docs/best-practices#using_custom_cache_keys_to_improve_cache_hit_ratioCloud CDN is a globally distributed content delivery network that helps to accelerate the delivery of your website or application content to users. When a user requests content from your website, Cloud CDN delivers the content from the nearest edge location, which helps to reduce latency and improve performance.
To improve the cache hit ratio, which means increasing the number of requests that are served from the cache instead of being sent back to the origin server, the following steps can be taken:
A. Customize the cache keys to omit the protocol from the key: The cache key is used to identify the content in the cache. By default, Cloud CDN includes the protocol (HTTP or HTTPS) in the cache key. By customizing the cache keys to omit the protocol, Cloud CDN can cache more content since the same content can be delivered over both HTTP and HTTPS protocols.
B. Shorten the expiration time of the cached objects: The expiration time determines how long the content is stored in the cache before it is evicted. By shortening the expiration time, Cloud CDN can cache more content since the cache is refreshed more frequently.
C. Make sure the HTTP(S) header Cache-Region points to the closest region of your users: Cloud CDN uses the HTTP(S) header Cache-Region to determine the best edge location to serve the content from. By setting the Cache-Region header to the closest region of your users, Cloud CDN can deliver the content from the nearest edge location, which helps to reduce latency and improve performance.
D. Replicate the static content in a Cloud Storage bucket. Point CloudCDN toward a load balancer on that bucket: This approach involves replicating the static content in a Cloud Storage bucket and pointing Cloud CDN towards a load balancer on that bucket. By doing so, Cloud CDN can deliver the content from the nearest edge location, which helps to reduce latency and improve performance. Additionally, Cloud Storage can serve the content directly to users if the content is not available in the cache, which helps to further reduce latency.
In conclusion, to improve the cache hit ratio with Cloud CDN, you can customize the cache keys, shorten the expiration time of cached objects, set the Cache-Region header, and replicate static content in a Cloud Storage bucket.