0
votes

We are using Google Cloud CDN with a backend-bucket. Everything works correctly, we see cache-hits etc. but the cache rate is lower than expected. Analyzing it, i recognized that none of the request has an age above 3600. Although our max-age is set to 86400. Setting it to something smaller works. Is this defined behaviour? Are we setting anything wrong?

Here are the headers for one of the files:

HTTP/2 200 
x-guploader-uploadid: AEnB2Ur4sV1ou6Av1U8OgQC8iNxgFmLzAbQ4bFQ4mBAYCyBOHviUAfAbkWFUycAUGLYDYbgNSdaw_zdkE6ySLdRTe0vScOh3Tw
date: Wed, 05 Sep 2018 14:40:29 GMT
expires: Thu, 06 Sep 2018 14:40:29 GMT
last-modified: Thu, 02 Mar 2017 15:31:23 GMT
etag: "1293d749638a24bf786a15f2a2a6ca76"
x-goog-generation: 1488468683233688
x-goog-metageneration: 3
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 89976
content-type: text/plain
x-goog-hash: crc32c=nIbPdQ==
x-goog-hash: md5=EpPXSWOKJL94ahXyoqbKdg==
x-goog-storage-class: STANDARD
accept-ranges: bytes
content-length: 89976
access-control-allow-origin: *
access-control-expose-headers: x-unity-version
access-control-expose-headers: origin
server: UploadServer
age: 3041
cache-control: public, max-age=86400
alt-svc: clear
1

1 Answers

0
votes

According to this Cloud CDN Documentation,

Note that a cache entry's expiration time is an upper bound on how long the cache entry remains valid. There is no guarantee that a cache entry will remain in the cache until it expires. Cache entries for unpopular content can be evicted to make room for new content. Regardless of the specified expiration time, cache entries that aren't accessed for 30 days are automatically removed.

That being said, we were able to reproduce the same behavior. Hence, in order to confirm if it is indeed an expected behavior or an issue, I have created a new issue on the Google Issue Tracker for your convenience.