I have a backend GCS bucket behind a Google Cloud HTTP(S) load balancer with Cloud CDN enabled.
I'm trying to answer these questions based on response headers:
- was this response served from CDN
- if so which location/region
- was this a cache hit/miss
Here are the response headers. Based on cache-control
, in theory, this should be cached. However, I don't see an indication of this that can verify CDN works correctly. Similarly all other headers x-goog-*
and Server: UploadServer
are seem to be coming from GCS server, not CDN.
accept-ranges: bytes
age: 551
alt-svc: clear
cache-control: public, max-age=3600
content-length: 298303
content-type: image/jpeg
date: Wed, 05 Aug 2020 23:07:33 GMT
etag: "f0b6c60f635c784dd7f34ab9c1527867"
expires: Thu, 06 Aug 2020 00:07:33 GMT
last-modified: Wed, 05 Aug 2020 23:07:16 GMT
server: UploadServer
status: 200
X-DNS-Prefetch-Control: off
x-goog-generation: 1596668836233926
x-goog-hash: crc32c=rD4sZw==
x-goog-hash: md5=8LbGD2NceE3X80q5wVJ4Zw==
x-goog-metageneration: 1
x-goog-storage-class: STANDARD
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 298303
x-guploader-uploadid: AAANsUktJ98kPCHjiR2oBi6N-[...]
For example, Cloudflare provides these response headers:
- where was the request served:
cf-ray: 5be4505beb76bca2-SEA
- what was the cache status:
cf-cache-status: REVALIDATED
- was my request hitting CDN or my backend directly
server: cloudflare