-2

I always was aware that http supports gzip compression, but never cared about it. I counted on that the servers and shared hosts I use would have activated it by default (I'm more of a frontend developer). Now I discover, that none of them has it. So my question is why? Are there any downsides? Is the computation more expensive then the saved bandwidth?

I googled, but didn't find a lot, that make sense ...

johjoh
  • 111
  • What is the problem you're trying to solve here? – EEAA Feb 10 '16 at 22:14
  • @EEAA to decide which it makes sense to activate it and understand why it isn't by default – johjoh Feb 11 '16 at 02:15
  • Like all capacity planning tasks, you need to test it on your workload with your users and your content to make that decision. – EEAA Feb 11 '16 at 02:22
  • @EEAA, I know. My questions wasn't only targeting capacity, they were just a guess. I was asking for the general downsides. – johjoh Feb 11 '16 at 11:58

1 Answers1

1

It increases your CPU usage, but reduces the network bandwidth required and therefore the time to download the page. gzip with a low compression level (1-2) does enough compression and doesn't take too many CPU cycles, there's no point going up to 9.

On a super high volume site you'd want to check that it doesn't impact your CPU more than it can handle, but I think it's almost always going to be a good trade-off between CPU, network, and cost.

CRIME exploit is relevant.

This question should've been a Google search, 10 seconds of research and you'd have had your answer.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • You should add that certain TLS protocols and Ciphers are exposed to vulnerabilities when used with compressed data (search for CRIME vulnerabilities). – Florin Asăvoaie Feb 10 '16 at 22:39
  • Interesting. Question doesn't specify encryption so assumed plain. Will research and add. – Tim Feb 10 '16 at 22:42
  • 1
    @Tim thanks for you answer, I did half an hour of Google search and it did not give me the answer. The question was for the general downsides, the computation costs were a guess. Beside I didn't know, that questions that could be answered by Google search are not welcome here. – johjoh Feb 11 '16 at 02:21
  • 1
    I'd say every question can be answered by Google if you spend enough time, so that's not quite right. Questions that can easily be answered with a single Google search and 5 minutes ready are probably best not posted on SO, you'd learn more and probably get a better result by doing your own reading and research anyway. – Tim Feb 11 '16 at 04:49