cache: add high-level cache API