require_once "g-sheet-sync.php";
+const TTL = 5 * 60; // time to live for the files in seconds
+
// credentials.json is the key file we downloaded while setting up our Google Sheets API
$credentialsPath = "credentials.json";
// the spreadsheet id (can be found in the url of the doc)
}
-# TODO: if get: save the json and serve always the same for 5 minutes or something like that
+# TODO: if get: save the json and serve always the same for TTL or something like that
# use a sha or md5 on the input to return the same output as requested.
// $filepath = "test.json";
// if file does not exist counts as expired
if (!$filetime) return true;
- // if file older than 5 minutes IS expired
- if ($filetime < time() - 300) return true;
+ // if file older than TTL minutes IS expired
+ if ($filetime < time() - TTL) return true;
// else file is NOT expired
return false;