arkadiy kraportov
arkadiy kraportov

Reputation: 3729

Compress JSON responses in Phoenix framework

What is the best way to gzip JSON responses from my Phoenix API server?

Is there any GZIP plug or should I have nginx in front of Phoenix?

Upvotes: 4

Views: 2291

Answers (1)

Bryan E
Bryan E

Reputation: 1091

You can configure gzip compression for all responses from a particular endpoint, such as the one used by your API.

config :app_name, AppName.Endpoint,
  http: [compress: true]

Upvotes: 9

Related Questions