Actually I tried that and there was an UnpicklingError. Probably the CacheInserter has to be adapted for pickled objects. However I would prefer to remove the pickled objects from the db rather than extending the CacheInserter, so I left the code as it was. This is work for the future.