A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/cdn/docs/using-cache-modes below:

Change cache modes | Cloud CDN

Skip to main content Change cache modes

Stay organized with collections Save and categorize content based on your preferences.

This page provides instructions for changing cache modes with Cloud CDN. Cache modes let you configure how Cloud CDN caches your content.

Before you begin Setting the cache mode

To configure cache modes for a Cloud CDN-enabled backend, do the following:

Console
  1. In the Google Cloud console, go to the Load Balancing page.

    Go to the Load balancing page

  2. Click the name of your external Application Load Balancer.
  3. Click Edit edit.
  4. In Backend configuration, select a backend and click Edit edit.
  5. Make sure that Enable Cloud CDN is selected.
  6. Under Cache mode, select one of the following options:
  7. Click Save.
gcloud

For backend services, use the gcloud compute backend-services create or gcloud compute backend-services update command with the --cache-mode flag.

For backend buckets, use the gcloud compute backend-buckets create or gcloud compute backend-buckets update command with the --cache-mode flag.

gcloud compute backend-services (create | update) BACKEND_SERVICE_NAME
    --cache-mode=CACHE_MODE
gcloud compute backend-buckets (create | update) BACKEND_BUCKET_NAME
    --cache-mode=CACHE_MODE

Replace CACHE_MODE with one of the following:

API

For backend buckets, use the Method: backendBuckets.insert or Method: backendBuckets.update API call.

For backend services, use the Method: backendServices.insert or Method: backendServices.update API call.

Use one of the following API calls:

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

Add the following snippet to the JSON request body:

"cdnPolicy": {
  "cacheMode": (CACHE_ALL_STATIC | USE_ORIGIN_HEADERS | FORCE_CACHE_ALL)

Replace CACHE_MODE with one of the following:

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

Last updated 2025-08-07 UTC.

[[["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-07 UTC."],[[["This page guides users on how to configure cache modes for Cloud CDN, which determines how content is cached."],["Users can set cache modes to `Cache static content`, `Use origin settings based on Cache-Control headers`, or `Force cache all content` via the Google Cloud console."],["The `gcloud` CLI can be used to set cache modes for backend services or buckets with the `--cache-mode` flag, offering options like `CACHE_ALL_STATIC`, `USE_ORIGIN_HEADERS`, and `FORCE_CACHE_ALL`."],["Cache modes can also be configured using API calls, specifically `Method: backendBuckets.insert/update` and `Method: backendServices.insert/update`, by modifying the `cacheMode` property in the request body's `cdnPolicy`."],["Each cache mode option (`CACHE_ALL_STATIC`, `USE_ORIGIN_HEADERS`, `FORCE_CACHE_ALL`) has distinct implications on what type of content is cached and how, depending on the nature of the content being served."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4