[SPY-85] JSON documents can't be compressed Created: 06/Apr/12  Updated: 29/May/13

Status: Open
Project: Spymemcached Java Client
Component/s: library
Affects Version/s: 2.8.1
Fix Version/s: .next
Security Level: Public

Type: Improvement Priority: Major
Reporter: Joshua Shanks Assignee: Michael Nitschinger
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

In SPY-58 compressing for JSON was disabled. We picked spymemcached because it did compression and couldn't find any documentation saying JSON wouldn't be compressed. Whether to compress JSON or not should be a configuration value that can be passed in much like compressionThreshold.

Currently our only solution appears to prepend one character that isn't { or [ and then remove it after doing a get. But I would say that not compressing any string just because it starts with a { or [ isn't really desirable because it means that if I expect/want compression of my string I now have to check every string I put into the client and prepend and remove a leading character just to get compression.

Comment by Matt Ingenthron [ 12/Apr/12 ]
We'll agree that it was probably not the best solution. We need to find a better approach for this. One strong consideration is enhancing flags, allowing compression and doing compression at both the client and the server. That requires more help from the server folks. The other challenge here is that there is no standard JSON type and even if there were, we'd not likely want to key off of it.

To address this for now, maybe it'd be best to have a way to disable this behavior?
Comment by Joshua Shanks [ 12/Apr/12 ]
Agreed some kind of configuration would be great. As someone who is using the client with a standard memcached server I think ideally the default would be to compress everything but as long as it was configurable and documented it'd be a step in the right direction. I was going to look at making it a configuration option but can't get all of the unit tests to run, maybe I can try again if SPY-86 get resolved.
Comment by Mike Wiederhold [ 15/Nov/12 ]
Lowering priority because this needs server side planning as well
Generated at Wed Nov 26 17:00:52 CST 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.