change cache logic from setTimeout to setInterval