Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

invalidate cache with query string on backends bucket

Hello,

i use gcp CDN with cache

i want to invalidate cache on my backend bucket files by adding query string to my request.

Ex : https://mydomain.com/myfile.js?version=123456

the command "gcloud beta compute backend-buckets update MYBUCKET \
--cache-key-include-query-string" listed on this page https://cloud.google.com/cdn/docs/using-cache-keys#gcloud_2  is not working .

I get the error "ERROR: (gcloud.beta.compute.backend-buckets.update) unrecognized arguments: --cache-key-include-query-string (did you mean '--cache-key-query-string-whitelist'?) "


My version of gcloud is updated :
Google Cloud SDK 368.0.0
alpha 2022.01.07
beta 2022.01.07
bq 2.0.72
core 2022.01.07
gsutil 5.6

Have you an idea of the problem ?

thanks

0 2 1,106
2 REPLIES 2

I also get an error with this command

gcloud compute backend-buckets update MYBUCKET \
    --enable-cdn \
    --no-cache-key-include-protocol

ERROR: (gcloud.compute.backend-buckets.update) unrecognized arguments: --no-cache-key-include-protocol

Is the documentation outdated ?

thanks

Tanglung; Hi. Have you tried using the Google Cloud console > Network Services > Cloud CDN page?   Select CUSTOM in Cache Key.  Also; check out the google help page: cloud.google.com/cdn/docs/using-cache-modes  thanks; pfrankwicz