Class CachePolicyCacheKeyPolicy.Builder (1.105.0)

public static final class CachePolicyCacheKeyPolicy.Builder extends GeneratedMessage.Builder<CachePolicyCacheKeyPolicy.Builder> implements CachePolicyCacheKeyPolicyOrBuilder

Message containing what to include in the cache key for a request for Cache Policy defined on Route Action.

Protobuf type google.cloud.compute.v1.CachePolicyCacheKeyPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllExcludedQueryParameters(Iterable<String> values)

public CachePolicyCacheKeyPolicy.Builder addAllExcludedQueryParameters(Iterable<String> values)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameter
Name Description
values Iterable<String>

The excludedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addAllIncludedCookieNames(Iterable<String> values)

public CachePolicyCacheKeyPolicy.Builder addAllIncludedCookieNames(Iterable<String> values)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameter
Name Description
values Iterable<String>

The includedCookieNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addAllIncludedHeaderNames(Iterable<String> values)

public CachePolicyCacheKeyPolicy.Builder addAllIncludedHeaderNames(Iterable<String> values)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameter
Name Description
values Iterable<String>

The includedHeaderNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addAllIncludedQueryParameters(Iterable<String> values)

public CachePolicyCacheKeyPolicy.Builder addAllIncludedQueryParameters(Iterable<String> values)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameter
Name Description
values Iterable<String>

The includedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addExcludedQueryParameters(String value)

public CachePolicyCacheKeyPolicy.Builder addExcludedQueryParameters(String value)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameter
Name Description
value String

The excludedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addExcludedQueryParametersBytes(ByteString value)

public CachePolicyCacheKeyPolicy.Builder addExcludedQueryParametersBytes(ByteString value)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameter
Name Description
value ByteString

The bytes of the excludedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedCookieNames(String value)

public CachePolicyCacheKeyPolicy.Builder addIncludedCookieNames(String value)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameter
Name Description
value String

The includedCookieNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedCookieNamesBytes(ByteString value)

public CachePolicyCacheKeyPolicy.Builder addIncludedCookieNamesBytes(ByteString value)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameter
Name Description
value ByteString

The bytes of the includedCookieNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedHeaderNames(String value)

public CachePolicyCacheKeyPolicy.Builder addIncludedHeaderNames(String value)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameter
Name Description
value String

The includedHeaderNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedHeaderNamesBytes(ByteString value)

public CachePolicyCacheKeyPolicy.Builder addIncludedHeaderNamesBytes(ByteString value)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameter
Name Description
value ByteString

The bytes of the includedHeaderNames to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedQueryParameters(String value)

public CachePolicyCacheKeyPolicy.Builder addIncludedQueryParameters(String value)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameter
Name Description
value String

The includedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

addIncludedQueryParametersBytes(ByteString value)

public CachePolicyCacheKeyPolicy.Builder addIncludedQueryParametersBytes(ByteString value)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameter
Name Description
value ByteString

The bytes of the includedQueryParameters to add.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

build()

public CachePolicyCacheKeyPolicy build()
Returns
Type Description
CachePolicyCacheKeyPolicy

buildPartial()

public CachePolicyCacheKeyPolicy buildPartial()
Returns
Type Description
CachePolicyCacheKeyPolicy

clear()

public CachePolicyCacheKeyPolicy.Builder clear()
Returns
Type Description
CachePolicyCacheKeyPolicy.Builder
Overrides

clearExcludedQueryParameters()

public CachePolicyCacheKeyPolicy.Builder clearExcludedQueryParameters()

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludeHost()

public CachePolicyCacheKeyPolicy.Builder clearIncludeHost()

If true, requests to different hosts will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the host is never included in a Backend Bucket's cache key. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_host = 486867679;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludeProtocol()

public CachePolicyCacheKeyPolicy.Builder clearIncludeProtocol()

If true, http and https requests will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the protocol is never included in a Backend Bucket's cache key. Attempting to set on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_protocol = 303507535;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludeQueryString()

public CachePolicyCacheKeyPolicy.Builder clearIncludeQueryString()

If true, include query string parameters in the cache key according to includedQueryParameters and excludedQueryParameters. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

optional bool include_query_string = 474036639;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludedCookieNames()

public CachePolicyCacheKeyPolicy.Builder clearIncludedCookieNames()

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludedHeaderNames()

public CachePolicyCacheKeyPolicy.Builder clearIncludedHeaderNames()

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

clearIncludedQueryParameters()

public CachePolicyCacheKeyPolicy.Builder clearIncludedQueryParameters()

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

getDefaultInstanceForType()

public CachePolicyCacheKeyPolicy getDefaultInstanceForType()
Returns
Type Description
CachePolicyCacheKeyPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getExcludedQueryParameters(int index)

public String getExcludedQueryParameters(int index)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The excludedQueryParameters at the given index.

getExcludedQueryParametersBytes(int index)

public ByteString getExcludedQueryParametersBytes(int index)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the excludedQueryParameters at the given index.

getExcludedQueryParametersCount()

public int getExcludedQueryParametersCount()

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Returns
Type Description
int

The count of excludedQueryParameters.

getExcludedQueryParametersList()

public ProtocolStringList getExcludedQueryParametersList()

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Returns
Type Description
ProtocolStringList

A list containing the excludedQueryParameters.

getIncludeHost()

public boolean getIncludeHost()

If true, requests to different hosts will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the host is never included in a Backend Bucket's cache key. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_host = 486867679;

Returns
Type Description
boolean

The includeHost.

getIncludeProtocol()

public boolean getIncludeProtocol()

If true, http and https requests will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the protocol is never included in a Backend Bucket's cache key. Attempting to set on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_protocol = 303507535;

Returns
Type Description
boolean

The includeProtocol.

getIncludeQueryString()

public boolean getIncludeQueryString()

If true, include query string parameters in the cache key according to includedQueryParameters and excludedQueryParameters. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

optional bool include_query_string = 474036639;

Returns
Type Description
boolean

The includeQueryString.

getIncludedCookieNames(int index)

public String getIncludedCookieNames(int index)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includedCookieNames at the given index.

getIncludedCookieNamesBytes(int index)

public ByteString getIncludedCookieNamesBytes(int index)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includedCookieNames at the given index.

getIncludedCookieNamesCount()

public int getIncludedCookieNamesCount()

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Returns
Type Description
int

The count of includedCookieNames.

getIncludedCookieNamesList()

public ProtocolStringList getIncludedCookieNamesList()

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Returns
Type Description
ProtocolStringList

A list containing the includedCookieNames.

getIncludedHeaderNames(int index)

public String getIncludedHeaderNames(int index)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includedHeaderNames at the given index.

getIncludedHeaderNamesBytes(int index)

public ByteString getIncludedHeaderNamesBytes(int index)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includedHeaderNames at the given index.

getIncludedHeaderNamesCount()

public int getIncludedHeaderNamesCount()

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Returns
Type Description
int

The count of includedHeaderNames.

getIncludedHeaderNamesList()

public ProtocolStringList getIncludedHeaderNamesList()

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Returns
Type Description
ProtocolStringList

A list containing the includedHeaderNames.

getIncludedQueryParameters(int index)

public String getIncludedQueryParameters(int index)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includedQueryParameters at the given index.

getIncludedQueryParametersBytes(int index)

public ByteString getIncludedQueryParametersBytes(int index)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includedQueryParameters at the given index.

getIncludedQueryParametersCount()

public int getIncludedQueryParametersCount()

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Returns
Type Description
int

The count of includedQueryParameters.

getIncludedQueryParametersList()

public ProtocolStringList getIncludedQueryParametersList()

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Returns
Type Description
ProtocolStringList

A list containing the includedQueryParameters.

hasIncludeHost()

public boolean hasIncludeHost()

If true, requests to different hosts will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the host is never included in a Backend Bucket's cache key. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_host = 486867679;

Returns
Type Description
boolean

Whether the includeHost field is set.

hasIncludeProtocol()

public boolean hasIncludeProtocol()

If true, http and https requests will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the protocol is never included in a Backend Bucket's cache key. Attempting to set on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_protocol = 303507535;

Returns
Type Description
boolean

Whether the includeProtocol field is set.

hasIncludeQueryString()

public boolean hasIncludeQueryString()

If true, include query string parameters in the cache key according to includedQueryParameters and excludedQueryParameters. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

optional bool include_query_string = 474036639;

Returns
Type Description
boolean

Whether the includeQueryString field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CachePolicyCacheKeyPolicy other)

public CachePolicyCacheKeyPolicy.Builder mergeFrom(CachePolicyCacheKeyPolicy other)
Parameter
Name Description
other CachePolicyCacheKeyPolicy
Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CachePolicyCacheKeyPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CachePolicyCacheKeyPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CachePolicyCacheKeyPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CachePolicyCacheKeyPolicy.Builder
Overrides

setExcludedQueryParameters(int index, String value)

public CachePolicyCacheKeyPolicy.Builder setExcludedQueryParameters(int index, String value)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify excludedQueryParameters or includedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

repeated string excluded_query_parameters = 124896150;

Parameters
Name Description
index int

The index to set the value at.

value String

The excludedQueryParameters to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludeHost(boolean value)

public CachePolicyCacheKeyPolicy.Builder setIncludeHost(boolean value)

If true, requests to different hosts will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the host is never included in a Backend Bucket's cache key. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_host = 486867679;

Parameter
Name Description
value boolean

The includeHost to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludeProtocol(boolean value)

public CachePolicyCacheKeyPolicy.Builder setIncludeProtocol(boolean value)

If true, http and https requests will be cached separately.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the protocol is never included in a Backend Bucket's cache key. Attempting to set on a route that points exclusively to Backend Buckets will result in a configuration error.

optional bool include_protocol = 303507535;

Parameter
Name Description
value boolean

The includeProtocol to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludeQueryString(boolean value)

public CachePolicyCacheKeyPolicy.Builder setIncludeQueryString(boolean value)

If true, include query string parameters in the cache key according to includedQueryParameters and excludedQueryParameters. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

Note: This field applies to routes that use backend services. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. For routes that point to a Backend Bucket, use includedQueryParameters to define which parameters should be part of the cache key.

optional bool include_query_string = 474036639;

Parameter
Name Description
value boolean

The includeQueryString to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludedCookieNames(int index, String value)

public CachePolicyCacheKeyPolicy.Builder setIncludedCookieNames(int index, String value)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.

repeated string included_cookie_names = 66987088;

Parameters
Name Description
index int

The index to set the value at.

value String

The includedCookieNames to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludedHeaderNames(int index, String value)

public CachePolicyCacheKeyPolicy.Builder setIncludedHeaderNames(int index, String value)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string included_header_names = 533756345;

Parameters
Name Description
index int

The index to set the value at.

value String

The includedHeaderNames to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.

setIncludedQueryParameters(int index, String value)

public CachePolicyCacheKeyPolicy.Builder setIncludedQueryParameters(int index, String value)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify includedQueryParameters or excludedQueryParameters, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string included_query_parameters = 2319076;

Parameters
Name Description
index int

The index to set the value at.

value String

The includedQueryParameters to set.

Returns
Type Description
CachePolicyCacheKeyPolicy.Builder

This builder for chaining.