I would like to store all my string using Utf8 String Codec with GZIP in python.
I tried below code but compression not happening properly. I don't know what's missing here. How to insert data into redis using gzip compression technique.
After insertion into redis it just printing some number like d49
import redis
import StringIO
import gzip
r = redis.StrictRedis(host='127.0.0.1', port=80, db=0, decode_responses=True)
out = StringIO.StringIO()
with gzip.GzipFile(fileobj=out, mode='w') as f:
value = f.write('this is my test value')
r.set('test', value)
Appreciated your help in advance!
Thanks