Fix logging to stdout in production.
Basic caching support.