Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A media company serves content through a global external Application Load Balancer with Cloud CDN enabled across example.com, www.example.com, static.example.com, and api.example.com.
The URL map has the following configuration:
/media/* to /origin-v3/media/* before forwarding to a Cloud Storage backend bucket./media/promo/ and /media/promo-archive/ store large assets./media/promo/ on www.example.com and static.example.com only.You must immediately purge the incorrect objects while minimizing origin load spikes, cache-fill latency, and egress costs on unaffected paths and domains.
What should you do?
gcloud compute url-maps invalidate-cdn-cache with --path="/*" to perform a full cache flush across the URL map.Specifying --path="/*" without a --host restriction performs a full cache flush (invalidating everything) across the entire Cloud CDN URL map. Every cached response across all directories, file types, and configured hostnames is marked invalid across Google's distributed edge caches simultaneously.
/media/promo-archive/ and unaffected content on example.com and api.example.com—to miss the cache and hit the Cloud Storage backend bucket concurrently.--host unspecified applies the flush to all four domains even though only two subdomains served the incorrect files.--path="/*" clears every cache entry associated with the load balancer's URL map in approximately 10 seconds.The organization executed a site-wide redesign, changed shared templates across all domains, or needed an emergency rollback where every cached path across the entire URL map was compromised and had to be discarded immediately.
gcloud compute url-maps invalidate-cdn-cache with --host="*.example.com" and --path="/media/promo*" in a single request.This command combines a single-level leading wildcard host (*.example.com) with an unbounded path prefix (/media/promo*). In Cloud CDN, a leading wildcard host matches every first-level subdomain under example.com, while a trailing * without a preceding / matches every URL path string starting with /media/promo.
/media/promo* omits the trailing slash before the asterisk, Cloud CDN matches both /media/promo/... and sibling paths such as /media/promo-archive/.... Evicting the high-traffic archive directory triggers massive, unnecessary cache fills from the Cloud Storage backend.*.example.com matches www.example.com, static.example.com, and api.example.com. Although it excludes the apex domain example.com, it unnecessarily invalidates valid cached responses on api.example.com.*.example.com matches one subdomain label only (www, static, api) and never matches the apex domain (example.com) or nested subdomains (v2.api.example.com).* as a literal character prefix, meaning /picture* matches /picture/cat.jpg, /pictures/dog.jpg, and /picture1.jpg.All first-level subdomains (including api.example.com) needed invalidation and you intentionally wanted to purge both /media/promo/ and any sibling paths starting with /media/promo (such as /media/promo-archive/).
gcloud compute url-maps invalidate-cdn-cache with --path="/origin-v3/media/promo/*" and omit the --host flag to match the rewritten backend path.This approach targets the post-rewrite origin path (/origin-v3/media/promo/*) defined in the URL map's rewrite rule while omitting the --host parameter. Cloud CDN evaluates invalidation matchers against the cache key derived from the incoming client request and, when no hostname is supplied, applies the invalidation across every domain on the URL map.
/media/promo/...), an invalidation targeting /origin-v3/media/promo/* fails to match the cached entries for /media/promo/. The stale branding images continue to be served from edge caches until their TTL expires or they are evicted.--host causes Cloud CDN to evaluate the invalidation across example.com, www.example.com, static.example.com, and api.example.com rather than limiting the scope to the two affected subdomains.host field targets every hostname configured on the URL map by default.Clients directly requested /origin-v3/media/promo/... without a URL rewrite rule in place, and every domain configured on the URL map served the incorrect objects and required simultaneous invalidation.
gcloud compute url-maps invalidate-cdn-cache with --path="/media/promo/*" twice: once with --host="www.example.com" and once with --host="static.example.com".Targeted cache invalidation in Cloud CDN uses specific matchers—such as exact hostnames (--host) combined with directory path prefixes (--path)—to declare a narrowly scoped subset of cached entries invalid. When Cloud CDN evaluates multiple matcher types in a single request, it applies boolean AND logic so only objects matching both the specified hostname and path pattern are removed from edge caches and refilled from the origin on the next request.
www.example.com and one for static.example.com leaves example.com and api.example.com untouched while staying well within the 500 invalidation requests per minute per project rate limit, taking effect in roughly 10 seconds.--path="/media/promo/*" accurately matches the cached entries./*) ensures only objects inside /media/promo/ are purged without evicting /media/promo-archive/.--host and --path restricts the blast radius of cache purging across multi-domain URL maps./media/promo/ on the two affected subdomains trigger fresh origin fetches./media/promo-archive/ continue serving directly from edge locations at low latency.Compared to a full cache flush (/*), a wildcard host (*.example.com), or a prefix without a trailing slash (/media/promo*), pairing exact --host values with --path="/media/promo/*" eliminates every unaffected cache entry from the purge scope. Because Cloud CDN invalidation is an operational tool for targeted recovery rather than routine updates, keeping the scope minimal avoids thundering-herd cache fills and keeps bandwidth costs low.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated