Gzip jackson exported model
I recently converted a set of json generating servlets to use the jackson sling model exporter. Previously, I used gzip encoding and wrote the http entity with a gzip writer after I had constructed the json objects myself--not a very fun or concise process.
I am thrilled with the clarity and brevity of the jackson exporter version's code, but the tradeoff is that the file sizes have increased greatly (sometimes by a factor of 10) since its no longer compressed. (The particular sticking point is with a list of 900 of our university's programs, which is 9.7MB as raw json, even if I cut the individual json objects down to only display the necessary information for my front-end code, it's still very large ~6MB, so I really need to compress.)
Is there an easy way to tell my servlet to export as gzip? Neither the sling docs or the jackson docs point to any simple solution such as exporter options or any other annotation.
I am currently trying to write my own gzip json exporter, based on JacksonExporter, but I can't really wrap my head around where the gzip compression would actually happen when using exporters, or even where the response body is written for that matter (so far, I just have the JacksonExporter copied and pasted in my package).
Thank you