'Gzip a given string content.'

def _compress_content(self, content):

    zbuf = BytesIO()
    zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
    try:
        zfile.write(force_bytes(content.read()))
    finally:
        zfile.close()
    zbuf.seek(0)
    return zbuf
