Google Professional Cloud Network Engineer Question 518
Single answerGoogle Cloud PlatformYour organization hosts a website using Cloud CDN to serve static assets. A critical bug was discovered in one of the cached JavaScript files, and an updated version has been pushed to the origin server. What is the best way to ensure that users immediately receive the updated version of the file?
- A
Invalidate the specific cached object using the 'invalidateCache' API.
- B
Delete the cache bucket associated with the Cloud CDN.
- C
Wait for the cached content to expire based on the configured TTL.
- D
Update the origin server and change the filename of the JavaScript file.
Show answer and explanation
Correct answer: A
Explanation
Invalidating the specific cached object using the 'invalidateCache' API is the most efficient and reliable way to ensure outdated content is replaced immediately in Cloud CDN. This avoids waiting for TTL expiration or making widespread changes to the application.
- A. Correct.
This is the correct method to remove a specific object from Cloud CDN's cache immediately. Using the 'invalidateCache' API ensures that the object is invalidated globally and users retrieve the updated content.
- B. Incorrect.
Deleting the cache bucket is not a valid method for managing Cloud CDN cache and could lead to service disruption. Cloud CDN does not use a storage bucket for caching.
- C. Incorrect.
Waiting for the TTL to expire might result in users continuing to receive outdated content until the expiration time, which is not suitable in a critical bug scenario.
- D. Incorrect.
While changing the filename can force clients to fetch a new version, it is not an ideal solution as it requires modifying references to the file across the application.