CACHE_ALL_STATIC(기본값): 정적 콘텐츠를 자동으로 캐시합니다. 캐시할 수 없다고 표시된 응답(Cache-Control 응답 헤더의 private 또는 no-store 지시문)은 캐시되지 않습니다. 동적 콘텐츠를 캐시하려면 콘텐츠에 유효한 캐싱 헤더가 있어야 합니다.
USE_ORIGIN_HEADERS: 원본에서 콘텐츠를 캐시하도록 유효한 캐싱 헤더를 설정해야 합니다. 이 헤더가 없는 응답은 Google 에지에서 캐시되지 않으며 요청마다 원본으로 완전히 이동해야 하므로 성능이 영향을 받고 원본 서버의 부하가 증가합니다.
FORCE_CACHE_ALL: Cache-Control 응답 헤더의 private 또는 no-store 지시문을 무시하고 모든 콘텐츠(성공적인 응답)를 캐시합니다. 이로 인해 사용자별 비공개(사용자 식별 가능) 콘텐츠를 캐시할 수 있습니다. Cloud Storage 버킷과 같이 비공개 또는 동적 콘텐츠를 제공하지 않는 백엔드에서만 이 모드를 사용 설정해야 합니다. 비공개 또는 동적 콘텐츠를 제공하는 백엔드에서는 이를 사용 설정하지 마세요.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendBuckets
PUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendBuckets/BACKEND_BUCKET
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendServices
PUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendServices/BACKEND_SERVICE
CACHE_ALL_STATIC (기본값): 원본이 유효한 캐싱 헤더를 설정하지 않는 경우 정적 콘텐츠를 자동으로 캐시합니다. 캐시할 수 없다고 표시된 응답(Cache-Control 응답 헤더의 private 또는 no-store 지시문)은 캐시되지 않습니다. 동적 콘텐츠를 캐시하려면 콘텐츠에 유효한 캐싱 헤더가 있어야 합니다.
USE_ORIGIN_HEADERS: 원본에서 콘텐츠를 캐시하도록 유효한 캐싱 헤더를 설정해야 합니다. 이 헤더가 없는 응답은 Google 에지에서 캐시되지 않으며 요청마다 원본으로 완전히 이동해야 하므로 성능이 영향을 받고 원본 서버의 부하가 증가합니다.
FORCE_CACHE_ALL: Cache-Control 응답 헤더의 private 또는 no-store 지시문을 무시하고 모든 콘텐츠(성공적인 응답)를 캐시합니다. 이로 인해 사용자별 비공개(사용자 식별 가능) 콘텐츠를 캐시할 수 있습니다. Cloud Storage 버킷과 같이 비공개 또는 동적 콘텐츠를 제공하지 않는 백엔드에서만 이 모드를 사용 설정해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis page guides users on how to configure cache modes for Cloud CDN, which determines how content is cached.\u003c/p\u003e\n"],["\u003cp\u003eUsers can set cache modes to \u003ccode\u003eCache static content\u003c/code\u003e, \u003ccode\u003eUse origin settings based on Cache-Control headers\u003c/code\u003e, or \u003ccode\u003eForce cache all content\u003c/code\u003e via the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e CLI can be used to set cache modes for backend services or buckets with the \u003ccode\u003e--cache-mode\u003c/code\u003e flag, offering options like \u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e, \u003ccode\u003eUSE_ORIGIN_HEADERS\u003c/code\u003e, and \u003ccode\u003eFORCE_CACHE_ALL\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCache modes can also be configured using API calls, specifically \u003ccode\u003eMethod: backendBuckets.insert/update\u003c/code\u003e and \u003ccode\u003eMethod: backendServices.insert/update\u003c/code\u003e, by modifying the \u003ccode\u003ecacheMode\u003c/code\u003e property in the request body's \u003ccode\u003ecdnPolicy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach cache mode option (\u003ccode\u003eCACHE_ALL_STATIC\u003c/code\u003e, \u003ccode\u003eUSE_ORIGIN_HEADERS\u003c/code\u003e, \u003ccode\u003eFORCE_CACHE_ALL\u003c/code\u003e) has distinct implications on what type of content is cached and how, depending on the nature of the content being served.\u003c/p\u003e\n"]]],[],null,["# Change cache modes\n\nThis page provides instructions for changing cache modes with\nCloud CDN. Cache modes let you configure how Cloud CDN\ncaches your content.\n\nBefore you begin\n----------------\n\n- Read about [cache modes and static content](/cdn/docs/caching#cache-modes).\n\n- Ensure that Cloud CDN is enabled; for instructions, see\n [Using Cloud CDN](/cdn/docs/using-cdn).\n\n- If necessary, update to the latest version of the Google Cloud CLI:\n\n ```\n gcloud components update\n ```\n | **Note:** Make sure that you're using gcloud CLI version `309.0.0` or later.\n\nSetting the cache mode\n----------------------\n\nTo configure cache modes for a Cloud CDN-enabled backend, do the\nfollowing: \n\n### Console\n\n1. In the Google Cloud console, go to the **Load Balancing** page.\n\n [Go to the Load balancing page](https://console.cloud.google.com/networking/loadbalancing/list)\n2. Click the name of your external Application Load Balancer.\n3. Click **Edit** edit.\n4. In **Backend configuration** , select a backend and click **Edit** edit.\n5. Make sure that **Enable Cloud CDN** is selected.\n6. Under **Cache mode** , select one of the following options:\n - **Cache static content (recommended)** : Static content is web assets that don't change for each user. Static content is based on the `Content-Type` in the response. For more information, see [static content](/cdn/docs/caching#static).\n - **Use origin settings based on Cache-Control headers** : Cache responses with [valid cache directives](/cdn/docs/caching#cacheability) in the response headers.\n - **Force cache all content** : Cache all successful content served by the origin, ignoring any `private` or `no-store` directives.\n7. Click **Save**.\n\n### gcloud\n\nFor backend services, use the [`gcloud compute backend-services\ncreate`](/sdk/gcloud/reference/compute/backend-services/create) or\n[`gcloud compute backend-services\nupdate`](/sdk/gcloud/reference/compute/backend-services/update) command\nwith the `--cache-mode` flag.\n\nFor backend buckets, use the [`gcloud compute backend-buckets\ncreate`](/sdk/gcloud/reference/compute/backend-buckets/create) or\n[`gcloud compute backend-buckets\nupdate`](/sdk/gcloud/reference/compute/backend-buckets/update) command\nwith the `--cache-mode` flag. \n\n```\ngcloud compute backend-services (create | update) BACKEND_SERVICE_NAME\n --cache-mode=CACHE_MODE\n``` \n\n```\ngcloud compute backend-buckets (create | update) BACKEND_BUCKET_NAME\n --cache-mode=CACHE_MODE\n```\n\nReplace \u003cvar translate=\"no\"\u003eCACHE_MODE\u003c/var\u003e with one of the following:\n\n- `CACHE_ALL_STATIC` (default): Automatically caches [static\n content](/cdn/docs/caching#static). Responses that are\n marked as uncacheable (`private` or `no-store` directives in\n `Cache-Control` response headers) aren't cached. To cache dynamic content,\n the content must have\n [valid caching headers](/cdn/docs/caching#cacheability).\n\n- `USE_ORIGIN_HEADERS`: Requires the origin to set\n [valid caching headers](/cdn/docs/caching#cacheability) to\n cache content. Responses without these headers aren't cached at Google's\n edge and require a full trip to the origin on every request, potentially\n impacting performance and increasing load on the origin server.\n\n- `FORCE_CACHE_ALL`: Caches all content (that is, successful responses),\n ignoring any `private` or `no-store` directives in `Cache-Control`\n response headers. This might result in caching of private, per-user\n (user identifiable) content. Only enable this on backends that\n are not serving private or dynamic content, such as Cloud Storage\n buckets. Don't enable this on backends that are serving private or dynamic\n content.\n\n### API\n\nFor backend buckets, use the\n[`Method: backendBuckets.insert`](/compute/docs/reference/rest/v1/backendBuckets/insert) or\n[`Method: backendBuckets.update`](/compute/docs/reference/rest/v1/backendBuckets/update)\nAPI call.\n\nFor backend services, use the\n[`Method: backendServices.insert`](/compute/docs/reference/rest/v1/backendServices/insert) or\n[`Method: backendServices.update`](/compute/docs/reference/rest/v1/backendServices/update)\nAPI call.\n\nUse one of the following API calls: \n\n```\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendBuckets\nPUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendBuckets/BACKEND_BUCKET\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendServices\nPUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/backendServices/BACKEND_SERVICE\n```\n\nAdd the following snippet to the JSON request body: \n\n```\n\"cdnPolicy\": {\n \"cacheMode\": (CACHE_ALL_STATIC | USE_ORIGIN_HEADERS | FORCE_CACHE_ALL)\n```\n\nReplace \u003cvar translate=\"no\"\u003eCACHE_MODE\u003c/var\u003e with one of the following:\n\n- `CACHE_ALL_STATIC` (default): Automatically caches [static\n content](/cdn/docs/caching#static) if the origin does not set\n [valid caching headers](/cdn/docs/caching#cacheability). Responses that\n are marked as uncacheable (`private` or `no-store` directives in\n `Cache-Control` response headers) aren't cached. To cache dynamic content,\n the content must have [valid caching headers](/cdn/docs/caching#cacheability).\n\n- `USE_ORIGIN_HEADERS`: Requires the origin to set [valid caching\n headers](/cdn/docs/caching#cacheability) to\n cache content. Responses without these headers aren't cached at Google's\n edge and require a full trip to the origin on every request, potentially\n impacting performance and increasing load on the origin server.\n\n- `FORCE_CACHE_ALL`: Caches all content (that is, successful responses),\n ignoring any `private` or `no-store` directives in `Cache-Control`\n response headers. This might result in caching of private, per-user\n (user identifiable) content. You should only enable this on backends\n that are not serving private or dynamic content, such as\n Cloud Storage buckets."]]