Rewind buffer before converting to String

Otherwise, you end up writing nothing to the cache