0

I have an API running in Cloud Run and I need to compress the responses with gzip. All the responses would be JSON objects.

What are my options to achieve this? Is there a configuration for this in Cloud Run? Do I need to use other service?

I used firebase functions before to serve the same API and the response was gzipped by default. In Cloud Run I can't find any option to do this automatically.

Oliver Sosa
  • 754
  • 9
  • 16
  • 3
    Cloud Run does not perform response body compression. [link](https://issuetracker.google.com/issues/147185337#comment21). Your app's middleware should process the `Accept-Encoding: gzip` header, compress, and return the response with the `Content-Encoding: gzip` header. App Engine does support response body compression [link](https://cloud.google.com/appengine/docs/legacy/standard/go111/how-requests-are-handled#response_compression) Note: AFAIK Firebase Functions does not peform response body compression. Double-check that code base for compression middleware. – John Hanley May 09 '23 at 03:13
  • 1
    That's the answer! – guillaume blaquiere May 09 '23 at 07:50

0 Answers0