
Answer-first summary for fast verification
Answer: Add a Cache-Control entry with value private to the metadata of the object you don't want to be cached anymore. Invalidate all the previously cached copies.
To prevent an object from being cached by Cloud CDN and ensure it is served directly from the origin, the correct approach is to set the Cache-Control metadata of the object to 'private'. This directive instructs Cloud CDN not to cache the object. Invalidating previously cached copies ensures immediate enforcement. - **Option A** is incorrect because making the object non-public would block access entirely, not just disable caching. - **Option B** is incorrect because moving the object to a private bucket would require URL changes and may disrupt access. - **Option C** is incorrect because lifecycle rules manage object lifecycle (e.g., deletion) and do not affect caching behavior. - **Option D** is correct as it directly addresses caching control via metadata and invalidates existing cached copies.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have a Cloud Storage bucket with two objects. Cloud CDN is enabled on the bucket, and both objects are currently cached. You need to ensure one of the objects is no longer cached and is always served directly from the origin to internet users.
What should you do?
A
Ensure that the object you don't want to be cached anymore is not shared publicly.
B
Create a new storage bucket, and move the object you don't want to be checked anymore inside it. Then edit the bucket setting and enable the private attribute.
C
Add an appropriate lifecycle rule on the storage bucket containing the two objects.
D
Add a Cache-Control entry with value private to the metadata of the object you don't want to be cached anymore. Invalidate all the previously cached copies.
No comments yet.