implement #cache_object helper, closes #1560