add cache support (unfinished)