zorkian / nagios-api

A REST-like, JSON interface to Nagios
BSD 3-Clause "New" or "Revised" License
586 stars 173 forks source link

Compress json output #15

Closed lozzd closed 11 years ago

lozzd commented 11 years ago

We're requesting the entire /state every 20 seconds for use with Nagdash (http://github.com/lozzd/Nagdash)... After having a quick look on why it was taking 4-5 seconds to load this, we realised we had 3.7MB of JSON being returned. It would be great to implement gzip HTTP compression for clients that support it to improve this. The 3.7MB state file gzipped is 269kb.

lozzd commented 11 years ago

That was fast. Thanks so much!

lozzd commented 11 years ago

Nagdash support for gzip encoding is live now: https://github.com/lozzd/Nagdash/commit/f27e34b1c7e16df1931e622442dba111b302b676

Difference it made to the network traffic on our Nagios server: bh-jifu3ekgg8480

Thanks again!