ranm8 / requestify

Simplifies node HTTP request making.
http://ranm8.github.io/requestify
MIT License
223 stars 55 forks source link

cache never expries #23

Closed jinweilin closed 8 years ago

jinweilin commented 9 years ago

This line if (!data || (data.created + request.cache.expires > new Date().getTime())) {

should be change if (!data || (data.created + request.cache.expires < new Date().getTime())) {

In Requestify.js, Line : 155

blanchma commented 8 years ago

Same here.

jack13 commented 8 years ago

Date().getTime() returns milliseconds, and according to readme the expires argument is in seconds so the condition should be:

if (!data || (data.created + request.cache.expires*1000 < new Date().getTime())) {

ranyitz commented 8 years ago

fixed with 4a30bdde0e3273014a64b848c810e04d5b73c533