ported cache magic api to go