implement cache directly as go code.