Google Professional Cloud Network Engineer Question 519
Single answerGoogle Cloud PlatformYou are using Cloud CDN to serve cached content for your website. A critical update was made to your website's static assets, and you need to ensure that users accessing the site immediately receive the updated content instead of the old cached version. What is the most effective way to achieve this?
- A
Purge the cached content using the Cloud CDN 'Invalidate cache' functionality.
- B
Wait for the cached content to expire based on its original TTL (time-to-live).
- C
Update the content on the backend and Cloud CDN will automatically detect the changes.
- D
Use a versioned URL for the updated assets (e.g., appending a query string or version identifier).
Show answer and explanation
Correct answer: A
Explanation
When you need to immediately remove outdated content from Cloud CDN caches, the 'Invalidate cache' functionality is the most effective method. It allows you to purge specific cached objects globally and ensures that users receive the updated content without waiting for the TTL to expire or making changes to URLs.
- A. Correct.
This is the correct answer. Using Cloud CDN's 'Invalidate cache' functionality allows you to immediately remove specific cached objects across all CDN edge locations, ensuring that users receive updated content.
- B. Incorrect.
This is incorrect because waiting for the cached content to expire can take too long, especially if the TTL is set to a high value. Users will continue to see stale content until the TTL expires.
- C. Incorrect.
This is incorrect because Cloud CDN does not automatically detect changes to the backend content. The cached content will remain until it expires or is explicitly invalidated.
- D. Incorrect.
This is incorrect because while versioned URLs are a good practice for cache management, they require changes to your application or frontend to reference the updated content. This is not an immediate solution for invalidating existing cached content.