Fixed a bug in caching when in production mode