fusion
fusion

Reputation: 1287

Http Compression on Binary Data

I am serving binary data through http. For the time being I use Content-Disposition: attachment.

Can I use the built in http compression (having the client request data with the header Accept-Encoding) to compress the attachment?

Or should I compress the attachment manually?

What is the proper way of serving compressed byte arrays through http?

Upvotes: 0

Views: 511

Answers (1)

CodeCaster
CodeCaster

Reputation: 151588

Content-disposition is merely a header instructing the browser to either render the response, or to offer it as a download to the user. It doesn't change any HTTP semantics, and it doesn't change how the response body is transferred or interpreted.

So just use the built-in compression that compresses the response body according to the request header Accept-encoding.

Upvotes: 1

Related Questions