Meme_Api icon indicating copy to clipboard operation
Meme_Api copied to clipboard

Compress the response via GZIP

Open nik6018 opened this issue 4 years ago • 1 comments

Hey,

Can you turn on GZIP compression for the server ? will reduce the payload size and might help in latency as well.

I can help out if you want :)

nik6018 avatar Aug 22 '21 06:08 nik6018

The response size of the API is for one meme is around 600-800 bytes.
I am not sure if turning on GZIP on this small of a response will have any real-life effect as the Maximum transmission unit (MTU) is around 1500 bytes, so even if you compress your 800 bytes to 500 bytes using GZIP, the transmission will take one complete MTU so you will technically be wasting CPU resources on nothing.

It might have some actual effect when you are requesting 100-1000 memes at once but I am not sure what percentage of calls made to this API would fall in this category

Refer to this article for more information -> https://www.computerworld.com/article/2693941/why-it-doesn-t-make-sense-to-gzip-all-content-from-your-web-server.html

jai-dewani avatar Sep 26 '21 07:09 jai-dewani