totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

Can not set cache for 60 seconds ? #720

Closed aalfiann closed 5 years ago

aalfiann commented 5 years ago

I've tried like this

var key = 'test-cache';
var item = CACHE(key);
var date = {timestamp:new Date().toISOString().replace("T"," ").replace("Z","").substr(0,19)};
if(!item){
  CACHE(key,date,'60 seconds');
  console.log(date);
} else {
  console.log(item);
}

but cache is always refresh after 2minutes?

whats the problem?

petersirka commented 5 years ago

Hi. There is a simple answer.

aalfiann commented 5 years ago

Solved. Thank you so much.