gcloud edge-cache services invalidate-cache

NAME
gcloud edge-cache services invalidate-cache - invalidate the cache for an EdgeCacheService resource
SYNOPSIS
gcloud edge-cache services invalidate-cache(SERVICE :--location=LOCATION)(--host=HOST--path=PATH--tags=[TAGS,…])[GCLOUD_WIDE_FLAG]
DESCRIPTION
Invalidate the cache entries associated with an EdgeCacheService resource.
EXAMPLES
To invalidate content via a tag, or tags for a given host for anEdgeCacheService named 'my-service':
gcloudedge-cacheservicesinvalidate-cachemy-service--tags="status=404"--host="media.example.com"

To invalidate all content under a specific path, specify an exact path, or aprefix. Prefixes are denoted with a trailing* character.

gcloudedge-cacheservicesinvalidate-cachemy-service--path="/static/*"

You can optionally combine this with a status code. For example, to invalidateall cached HTTP 404s:

gcloudedge-cacheservicesinvalidate-cachemy-service--tags="status=404"--path="/static/*"
POSITIONAL ARGUMENTS
Service resource - The EdgeCacheService resource you want to invalidate thecache for. The arguments in this group can be used to specify the attributes ofthis resource. (NOTE) Some attributes are not given arguments in this group butcan be set in other ways.

To set theproject attribute:

  • provide the argumentservice on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

SERVICE
ID of the service or fully qualified identifier for the service.

To set theservice attribute:

  • provide the argumentservice on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--location=LOCATION
The location Id.To set thelocation attribute:
  • provide the argumentservice on the command line with a fullyspecified name;
  • provide the argument--location on the command line;
  • use global location.
REQUIRED FLAGS
At least one of these must be specified:
--host=HOST
The hostname to invalidate against. You can specify an exact or wildcard host -e.g. "video.example.com" or ".example.com" - based on host component.
--path=PATH
The path to invalidate against. You can specify an exact or wildcard host - e.g."/videos/hls/139123.mp4" or "/manifests/" - based on path component.
--tags=[TAGS,…]
A list of cache tags used to identify cached objects.
  • Cache tags are specified when the response is first cached, by setting the"Cache-Tag" response header at the origin.
  • By default, all objects have a cache tag representing the HTTP status code ofthe response, the MIME content-type, and the origin.
  • Multiple cache tags in the same revalidation request are treated as boolean OR -e.g. tag1 OR tag2 OR tag3.
  • If a host and/or path are also specified, these are treated as boolean AND withany tags.

Up to 10 tags may be specified in a single invalidation request.

GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

API REFERENCE
This command uses thenetworkservices/v1 API. The fulldocumentation for this API can be found at:https://cloud.google.com/networking
NOTES
This variant is also available:
gcloudalphaedge-cacheservicesinvalidate-cache

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.