The next example doesn't works because when binary_type is application/json chalice encode the body. I created a PR to check if body is a bytes and skip extra conversion to bytes
import json
import gzip
from chalice import Chalice, Response
app = Chalice(app_name='gzipcontent')
app.api.binary_types.append('application/json')
@app.route('/')
def index():
blob = json.dumps({'hello': 'world'}).encode('utf-8')
payload = gzip.compress(blob)
return Response(body=payload, headers={'Content-Type': 'application/json', 'Content-Encoding': 'gzip'})