Question

Spaces CDN TTL question

Posted January 6, 2019 684 views
CDN

Just wondering - with the Spaces CDN, if you set a low TTL, does a client requesting an expired file (that hasn’t been modified):

1) Always download a new file from Origin > Edge > Client, or

2) The CDN Edge does a request to Origin, receives 304 Not Modified and returns the cached file from Edge > Client ?

??

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

Regardless of what TTL value you set if an object has expired from the CDN cache and you have CDN enabled when a request goes to the CDN and the object isn’t there, it is retrieved from the object store, cached, and then the cached object is returned to the source making the request.

The idea is that the cache is always kept fresh. So you want to limit the number of times that objects are being transferred so its:

Request -> CDN -> object expired -> Object Store -> Cached in CDN -> Returned

Submit an Answer