A RetroSearch Logo

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

Search Query:

Showing content from https://developers.google.com/storage/docs/caching below:

Caching | Cloud Storage | Google Cloud

Caching

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

This page discusses the options you have to control how your Cloud Storage objects are cached. This page focuses on the Cloud Storage built-in cache and Cloud CDN, but Cloud Storage is also compatible with third-party CDNs.

Overview

When a Cloud Storage object is cached, copies of the object data are stored in a Google or internet cache so your object can be served faster in future requests. While caching can improve performance, you also risk serving stale content if you make updates to your object but a cache continues to serve the earlier version of the object.

Built-in caching for Cloud Storage

Cloud Storage can behave like a Content Delivery Network (CDN) with no work on your part, because an object's data is cached in the Cloud Storage network if its Cache-Control metadata is set to allow caching and the following criteria are met:

Important: Proxies or browsers might cache object data and subsequently serve object data from their cache based solely on the object's Cache-Control metadata. Additionally, depending on the network path, once object data has left Cloud Storage, the Cache-Control value associated with it might be overwritten, for example by a CDN that the data passes through.

Cloud Storage respects standard values for Cache-Control, such as the following:

To set the Cache-Control metadata for an object, see Editing object metadata.

Built-in caching behavior with IAM Deny policies

When there's an organization-level IAM Deny policy that restricts read access for an object from the principal identifier allUsers, built-in caching is disabled for the object, even if there's a bucket-level IAM policy that grants read access for the object to allUsers. However, if the IAM Deny policy only restricts individual users, built-in caching remains enabled for the object.

Performance considerations

Performance can be much better for publicly cacheable objects. If you have an object being used to control many clients and thus want to disable caching to provide the latest data:

Use Anywhere Cache with your buckets

Anywhere Cache is a fully-managed, always consistent Cloud Storage feature that lets you create caches in the same zone as your workloads. The caches can then be used to complete data read requests instead of your multi-region bucket, helping you control storage costs while running large, data-intensive workloads that would otherwise incur multi-region data transfer fees and impact performance. To learn more about Anywhere Cache, its benefits, and when you should use this feature, see Anywhere Cache overview.

Cloud Storage with Cloud CDN

For the best performance when delivering content to users, we recommend using Cloud Storage with Cloud CDN.

To use Cloud CDN, you must use an external Application Load Balancer with your Cloud Storage buckets as a backend. For a tutorial on setting up an HTTP(S) load balancer with a Cloud Storage bucket, see Hosting a static website.

Cloud CDN cache modes allow you to apply a unified caching configuration across all your objects. Cloud CDN uses the Cache-Control metadata set on your objects to determine how they should be cached, unless you override the Cache-Control metadata using a cache mode or TTL limit.

When choosing between Cloud Storage built-in caching and Cloud CDN, consider the following:

Feature Cloud Storage Cloud CDN Max cacheable file size 10 MiB 100 GiB 1 Default cache expiration 1 hour 1 hour (configurable) Support for custom domains over HTTPS No Yes Cache invalidation No Yes

1The maximum cacheable file size for Cloud CDN is 100 GiB if the origin server supports byte range requests. If the origin server doesn't support byte range requests, the maximum cacheable file size for Cloud CDN is 10 MiB.

Pricing considerations

In terms of pricing, the choice between Cloud Storage built-in caching and Cloud CDN depends on how much data you serve every month, which determines the amount of networking costs you incur.

What's next

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."],[],[]]


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