Improved the CacheInserter to write on a StringIO directly
Added a forgotten stringio.reset()