Fix caching code

Seems to work locally but not on app harbor yet