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.
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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[[["\u003cp\u003eThis document provides versioned reference documentation for the \u003ccode\u003eCacheMode\u003c/code\u003e enum within the Google Cloud Compute Engine v1 API, specifically for the \u003ccode\u003eBackendServiceCdnPolicy.Types\u003c/code\u003e namespace, with the latest version being 3.6.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCacheMode\u003c/code\u003e enum dictates how content is cached, offering options such as \u003ccode\u003eUSE_ORIGIN_HEADERS\u003c/code\u003e, \u003ccode\u003eFORCE_CACHE_ALL\u003c/code\u003e, and \u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eUSE_ORIGIN_HEADERS\u003c/code\u003e relies on the origin server to provide caching headers, while \u003ccode\u003eFORCE_CACHE_ALL\u003c/code\u003e caches all content regardless of headers, which may lead to caching user-specific data, and \u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e only automatically caches static content.\u003c/p\u003e\n"],["\u003cp\u003eThere are several other members of the enum such as \u003ccode\u003eUndefinedCacheMode\u003c/code\u003e and \u003ccode\u003eInvalidCacheMode\u003c/code\u003e which can be used in order to convey the state of a given enum.\u003c/p\u003e\n"],["\u003cp\u003eThe document contains a version history of the API with versions ranging from 1.0.0 to 3.6.0.\u003c/p\u003e\n"]]],[],null,[]]