Reimplement caching correctly for #215 and #223
Add back some comments lost in the revert