Reference documentation and code samples for the Compute Engine v1 API enum BackendServiceCdnPolicy.Types.CacheMode.
Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC.
Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached.
ForceCacheAll
Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content.
InvalidCacheMode
UndefinedCacheMode
A value indicating that the enum field is not set.
UseOriginHeaders
Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[[["\u003cp\u003eThe latest version of \u003ccode\u003eBackendServiceCdnPolicy.Types.CacheMode\u003c/code\u003e is 3.6.0, with multiple previous versions available, ranging back to version 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBackendServiceCdnPolicy.Types.CacheMode\u003c/code\u003e is an enum used within the Compute Engine v1 API to define cache settings for responses from a backend, located within the Google.Cloud.Compute.V1 namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe CacheMode options include \u003ccode\u003eUSE_ORIGIN_HEADERS\u003c/code\u003e, \u003ccode\u003eFORCE_CACHE_ALL\u003c/code\u003e, and \u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e, each dictating different caching behaviors, such as requiring origin headers or caching all content regardless of headers.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e is the default setting for \u003ccode\u003ecdnPolicy.cacheMode\u003c/code\u003e when no value is explicitly provided, and it automatically caches static content while dynamic content remains unchached.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGoogle.Cloud.Compute.V1.BackendServiceCdnPolicy.Types.CacheMode\u003c/code\u003e enum contains \u003ccode\u003eInvalidCacheMode\u003c/code\u003e and \u003ccode\u003eUndefinedCacheMode\u003c/code\u003e to specify when no value or an invalid value was provided for the enum.\u003c/p\u003e\n"]]],[],null,[]]