CartoDB / CartoDB-SQL-API

CartoDB SQL API
BSD 3-Clause "New" or "Revised" License
63 stars 65 forks source link

Be able to synchronize the TTL of cache-control header to expire in a… #626

Closed dgaubert closed 5 years ago

dgaubert commented 5 years ago

… coherent way

dgaubert commented 5 years ago

Tests in staging

After deploying this branch in staging, I've created a "non-cartodbfied" table and I made some requests through CDN in order to check the behavior of the new TTL to have synced invalidation for free.

For the following query select cartodb_id, random() from test_ttl limit 1; where each call should give a unique result. For instance:

=> select cartodb_id, random() from test_ttl limit 1;
 cartodb_id |      random
------------+------------------
          1 | 0.45452244579792
(1 row)

=> select cartodb_id, random() from test_ttl limit 1;
 cartodb_id |      random
------------+-------------------
          1 | 0.774238015525043
(1 row)

I've sent the following requests (omitted non-relevant headers):

Where:

Note: See the new Last-Modified and the max-age should give an idea when the next TTL is going to expire (15:50)