Return cached code if necessary.
Workaround for returned deferred object.
Convert buffer to string.
Add test for cache invalidation.