I've been trying to cache something for 65 days but noticed that the cache has been expiring and the file removed. Date.now() returns milliseconds elapsed since Jan 1st 1970 00:00: 00 UTC. So the value passed to put is actually treated as MS, not seconds. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now
Repro
- Put an Item in the cache with seconds param set to:
5616000
- Expected that the unix timestamp in the TTL is 1603391361815 (Oct 22, 65 days from Aug 18)
- Actual timestamp in the cache is 2 hours later.
I can fix it locally by multiplying my value by 1000 which gives me the unix timestamp I expect.
I've been trying to cache something for 65 days but noticed that the cache has been expiring and the file removed. Date.now() returns milliseconds elapsed since Jan 1st 1970 00:00: 00 UTC. So the value passed to put is actually treated as MS, not seconds. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now
Repro
5616000I can fix it locally by multiplying my value by 1000 which gives me the unix timestamp I expect.