{"id":79885,"date":"2020-09-22T06:38:17","date_gmt":"2020-09-22T06:38:17","guid":{"rendered":"https:\/\/www.baeldung.com\/?p=87448"},"modified":"2020-09-22T06:38:17","modified_gmt":"2020-09-22T06:38:17","slug":"reducing-json-data-size","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2020\/09\/22\/reducing-json-data-size\/","title":{"rendered":"Reducing JSON Data Size"},"content":{"rendered":"<p class=\"syndicated-attribution\"><meta name= \\\"keywords \\\" content= \\\"\u96fb\u5b50\u8a08\u7b97\u6a5f, \u6559\u80b2, IT \u96fb\u8166\u73ed,\u96fb\u8166\u88dc\u7fd2\uff0c \u96fb\u8166\u73ed\uff0c \u5bb6\u6559\uff0c \u79c1\u4eba\u8001\u5e2b\uff0c \u8cc7\u8a0a\u6280\u8853\uff0c \u7a0b\u5e8f\u8a2d\u8a08\uff0c \u96fb\u5b50\u8a08\u7b97\u6a5f\uff0c \u904a\u6232\uff0c \u860b\u679c\uff0c \u96fb\u5f71\uff0c \u8a08\u7b97\u6a5f\uff0c\u7de8\u78bc\uff0c Java\uff0c C\/C++\uff0c JavaScript\uff0c PHP\uff0c HTML\uff0c CSS\uff0c MySQL\uff0c mobile\uff0c Android\uff0c \u52d5\u6f2b\uff0c Python\uff0c teacher\uff0c \u88dc\u7fd2\uff0c \u96fb\u8166\u88dc\u7fd2 \u8cc7\u8a0a, \u7535\u5b50\u8ba1\u7b97\u673a, IT ,Game, apple, movie, Computer,student,Java,\u6559\u80b2, ,\u5b66\u751f, \u5b66\u4e60, learn, \u6559\u5b66,  Android, apple,anime, animation, \u4fe1\u606f\u6280\u672f, \u7a0b\u5e8f\u8bbe\u8ba1, \u79fb\u52a8\u7535\u8bdd, \u8cc7\u8a0a\u79d1\u6280,Game, Jeu, Juego,Call Of Duty ,\u4f7f\u547d\u53ec\u559a , \u6e38\u620f, \u7535\u5b50\u6e38\u620f,, \u591a\u4eba\u7535\u5b50\u6e38\u620f, \u7f51\u7edc\u6e38\u620f\uff0conline\uff0conline game, \u624b\u673a\u6e38\u620f, mobile \\\"><\/p>\n<h2  data-id=\"introduction\">1. Introduction<\/h2>\n<div class=\"bd-anchor\" id=\"introduction\"><\/div>\n<p>Java applications often use JSON as a common format for sending and receiving data. Moreover, it&#8217;s used as a serialization protocol for storing data. With smaller JSON data sizes, our applications become cheaper and faster.<\/p>\n<p>In this tutorial, we&#8217;ll look at various ways of reducing the size of <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-org-json\">JSON<\/a> in our Java applications.<\/p>\n<h2  data-id=\"domain\">2. Domain Model and Test Data<\/h2>\n<div class=\"bd-anchor\" id=\"domain\"><\/div>\n<p>Let&#8217;s create a domain model for a <em>Customer<\/em> with some contact data:<\/p>\n<pre><code class=\"language-java\">public class Customer {\r\n    private long id;\r\n    private String firstName;\r\n    private String lastName;\r\n    private String street;\r\n    private String postalCode;\r\n    private String city;\r\n    private String state;\r\n    private String phoneNumber;\r\n    private String email;<\/code><\/pre>\n<p>Note that all fields will be mandatory, except for <em>phoneNumber<\/em> and <em>email<\/em>.<\/p>\n<p>To properly test JSON data size differences, we need at least a few hundred <em>Customer<\/em> instances. They must have different data to make our tests more lifelike. The data generation web site <em><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.mockaroo.com\">mockaroo<\/a><\/em> helps us here. We can create 1,000 JSON data records there for free, in our own format, and with authentic test data.<\/p>\n<p>Let&#8217;s configure <em>mockaroo<\/em> for our domain model:<\/p>\n<p><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/wp-content\/uploads\/2020\/09\/JSON-generation.png\"><img decoding=\"async\" loading=\"lazy\" width=\"658\" height=\"488\" class=\"alignnone size-full wp-image-87454\" src=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2020\/09\/JSON-generation.png\" alt=\"\" srcset=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2020\/09\/JSON-generation.png 658w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2020\/09\/JSON-generation-300x222.png 300w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2020\/09\/JSON-generation-100x74.png 100w\" sizes=\"(max-width: 658px) 100vw, 658px\" \/><\/a><\/p>\n<p>Here, some items to keep in mind:<\/p>\n<ul>\n<li>This is where we specified the field names<\/li>\n<li>Here we selected the data types of our fields<\/li>\n<li>50% of the phone numbers are empty in the mock data<\/li>\n<li>30% of the email addresses are empty, too<\/li>\n<\/ul>\n<p>All the code examples below use the same data of 1,000 customers from <em>mockaroo<\/em>. We use the factory method <em>Customer.fromMockFile() <\/em>to read that file and turn it into <em>Customer<\/em> objects.<\/p>\n<p>We&#8217;ll be using <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/jackson\">Jackson<\/a> as our JSON processing library.<\/p>\n<h2  data-id=\"default\">3. JSON Data Size with Jackson Default Options<\/h2>\n<div class=\"bd-anchor\" id=\"default\"><\/div>\n<p>Let&#8217;s write a Java object to JSON with the default Jackson options:<\/p>\n<pre><code class=\"language-java\">Customer[] customers = Customer.fromMockFile();\r\nObjectMapper mapper = new ObjectMapper();\r\nbyte[] feedback = mapper.writeValueAsBytes(customers); <\/code><\/pre>\n<p>Let&#8217;s see the mock data for the first <em>Customer<\/em>:<\/p>\n<pre><code class=\"language-json\">{\r\n  \"id\" : 1, \r\n  \"firstName\" : \"Horatius\", \r\n  \"lastName\" : \"Strognell\", \r\n  \"street\" : \"4848 New Castle Point\", \r\n  \"postalCode\" : \"33432\", \r\n  \"city\" : \"Boca Raton\", \r\n  \"state\" : \"FL\", \r\n  \"phoneNumber\" : \"561-824-9105\", \r\n  \"email\" : \"hstrognell0@dailymail.co.uk\"\r\n}<\/code><\/pre>\n<p><strong>When using default Jackon options, the JSON data byte array with all 1,000 customers is 181.0 KB in size<\/strong>.<\/p>\n<h2  data-id=\"gzip\">4. Compressing with <em>gzip<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"gzip\"><\/div>\n<p>As text data, JSON data compresses nicely. That&#8217;s why <em>gzip <\/em>is our first option to reduce the JSON data size. Moreover, it can be automatically applied in HTTP, the common protocol for sending and receiving JSON.<\/p>\n<p><strong>Let&#8217;s take the JSON produced with the default Jackson options and compress it with <em>gzip<\/em>. This results in 45.9 KB, just 25.3% of the original size<\/strong>. So if we can enable <em>gzip<\/em> compression through configuration, we&#8217;ll cut down the JSON data size by 75% without any change to our Java code!<\/p>\n<p>If our Spring Boot application delivers the JSON data to other services or front-ends, then we&#8217;ll enable <em>gzip<\/em> compression in the Spring Boot configuration. Let&#8217;s see a typical compression configuration in YAML syntax:<\/p>\n<pre><code class=\"language-yaml\">server:\r\n  compression:\r\n    enabled: true\r\n    mime-types: text\/html,text\/plain,text\/css,application\/javascript,application\/json\r\n    min-response-size: 1024\r\n<\/code><\/pre>\n<p>First, we enabled compression in general by setting <em>enabled<\/em> as true. Then, we specifically enabled JSON data compression by adding <em>application\/json<\/em> to the list of <em>mime-types<\/em>. Finally, notice that we set <em>min-response-size<\/em> to 1,024 bytes long. This is because if we compress short amounts of data, we may produce bigger data than the original.<\/p>\n<p>Often, proxies such as <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.nginx.com\">NGINX<\/a>\u00a0or web servers such as the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/httpd.apache.org\">Apache HTTP Server<\/a>\u00a0deliver the JSON data to other services or front-ends. Configuring JSON data compression in these tools is beyond the scope of this tutorial.<\/p>\n<p><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/linux\/gzip-and-gunzip\">A previous tutorial on <em>gzip<\/em><\/a> tells us that <em>gzip<\/em> has various compression levels. Our code examples use\u00a0<em>gzip<\/em> with the default Java compression level. Spring Boot, proxies, or web servers may get different compression results for the same JSON data.<\/p>\n<p>If we use JSON as the serialization protocol to store data, we&#8217;ll need to compress and decompress the data ourselves.<\/p>\n<h2  data-id=\"shorter\">5. Shorter Field Names in JSON<\/h2>\n<div class=\"bd-anchor\" id=\"shorter\"><\/div>\n<p>It&#8217;s a best practice to use field names that are neither too short nor too long. Let&#8217;s omit this for the sake of demonstration: We&#8217;ll use single-character field names in JSON, but we&#8217;ll not change the Java field names. This reduces the JSON data size but lowers JSON readability. Since it would also require updates to all services and front-ends, we&#8217;ll probably use these short field names only when storing data:<\/p>\n<pre><code class=\"language-json\">{\r\n  \"i\" : 1,\r\n  \"f\" : \"Horatius\",\r\n  \"l\" : \"Strognell\",\r\n  \"s\" : \"4848 New Castle Point\",\r\n  \"p\" : \"33432\",\r\n  \"c\" : \"Boca Raton\",\r\n  \"a\" : \"FL\",\r\n  \"o\" : \"561-824-9105\",\r\n  \"e\" : \"hstrognell0@dailymail.co.uk\"\r\n}<\/code><\/pre>\n<p>It&#8217;s easy to change the JSON field names with Jackson while leaving the Java field names intact. We&#8217;ll use the <em>@JsonProperty<\/em> annotation:<\/p>\n<pre><code class=\"language-java\">@JsonProperty(\"p\")\r\nprivate String postalCode;\r\n<\/code><\/pre>\n<p><strong>Using single-character field names leads to data that is 72.5% of the original size. Moreover, using <em>gzip will <\/em>compress that to 23.8%.<\/strong> That&#8217;s not much smaller than the 25.3% we got from simply compressing the original data with <em>gzip<\/em>. We always need to look for a suitable cost-benefit relation. Losing readability for a small gain in size won&#8217;t be recommendable for most scenarios.<\/p>\n<h2  data-id=\"array\">6. Serializing to an Array<\/h2>\n<div class=\"bd-anchor\" id=\"array\"><\/div>\n<p>Let&#8217;s see how we can further reduce the JSON data size by leaving out the field names altogether. We can achieve this by storing a <em>customers<\/em> array in our JSON. Notice that we&#8217;ll be also reducing readability. And we&#8217;ll also need to update all the services and front-ends that use our JSON data:<\/p>\n<pre><code class=\"language-json\">[ 1, \"Horatius\", \"Strognell\", \"4848 New Castle Point\", \"33432\", \"Boca Raton\", \"FL\", \"561-824-9105\", \"hstrognell0@dailymail.co.uk\" ]\r\n<\/code><\/pre>\n<p><strong>Storing the <em>Customer<\/em> as an array leads to output that&#8217;s 53.1% of the original size, and 22.0% with <em>gzip<\/em> compression.<\/strong> This is our best result so far. Still, 22% is not significantly smaller than the 25.3% we got from merely compressing the original data with <em>gzip<\/em>.<\/p>\n<p>In order to serialize a customer as an array, we need to take full control of JSON serialization. Refer again to our <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/jackson-object-mapper-tutorial\">Jackson<\/a> tutorial for more examples.<\/p>\n<h2  data-id=\"null-values\">7. Excluding <em>null<\/em> Values<\/h2>\n<div class=\"bd-anchor\" id=\"null-values\"><\/div>\n<p>Jackson and other JSON processing libraries may not handle JSON <em>null<\/em> values correctly when reading or writing JSON. For example, Jackson writes a JSON <em>null<\/em> value by default when it encounters a Java <em>null<\/em> value. That&#8217;s why <strong>it&#8217;s a good practice to remove empty fields in JSON data<\/strong>. This leaves the initialization of empty values to each JSON processing library and reduces the JSON data size.<\/p>\n<p>In our mock data, we set 50% of the phone numbers, and 30% of the email addresses, as empty. Leaving out these <em>null<\/em> values reduces our JSON data size to 166.8kB or 92.1% of the original data size. Then, <em>gzip <\/em>compression will\u00a0drop it to 24.9%.<\/p>\n<p>Now, <strong>if we combine ignoring <em>null<\/em> values with the shorter field names from the previous section, then we&#8217;ll get more significant savings: 68.3% of the original size and 23.4% with <em>gzip<\/em><\/strong>.<\/p>\n<p>We can configure the omission of <em>null<\/em> value fields in Jackson <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/jackson-ignore-null-fields#on-class\">per class<\/a> or <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/jackson-ignore-null-fields#globally\">globally for all classes<\/a>.<\/p>\n<h2  data-id=\"new\">8. New Domain Class<\/h2>\n<div class=\"bd-anchor\" id=\"new\"><\/div>\n<p>We achieved the smallest JSON data size so far by serializing it to an array. <strong>One way of reducing that even further is a new domain model with fewer fields. <\/strong>But why would we do that?<\/p>\n<p>Let&#8217;s imagine a front-end for our JSON data that shows all customers as a table with two columns: name and street address. Let&#8217;s write JSON data specifically for this front-end:<\/p>\n<pre><code class=\"language-json\">{\r\n  \"id\" : 1,\r\n  \"name\" : \"Horatius Strognell\",\r\n  \"address\" : \"4848 New Castle Point, Boca Raton FL 33432\"\r\n}<\/code><\/pre>\n<p>Notice how we concatenated the name fields into <em>name<\/em> and the address fields into <em>address<\/em>. Also, we left out <em>email<\/em> and <em>phoneNumber<\/em>.<\/p>\n<p>This should produce much smaller JSON data. It also saves the front-end from concatenating the <em>Customer<\/em> fields. But on the downside, this <strong>couples our back-end tightly to the front-end<\/strong>.<\/p>\n<p>Let&#8217;s create a new domain class <em>CustomerSlim<\/em> for this front-end:<\/p>\n<pre><code class=\"language-java\">public class CustomerSlim {\r\n    private long id;\r\n    private String name;\r\n    private String address;<\/code><\/pre>\n<p>If we convert our test data to this new <em>CustomerSlim<\/em> domain class, we\u2018ll reduce it to 46.1% of the original size. That will be using the default Jackson settings. If we use <em>gzip<\/em> it goes down to 15.1%. This last result is already a significant gain over the previous best result of 22.0%.<\/p>\n<p>Next, if we also use one-character field names, this gets us down to 40.7% of the original size, with <em>gzip<\/em> further reducing this to 14.7%. This result is only a small gain over the 15.1% we reached with the Jackson default settings.<\/p>\n<p>No fields in <em>CustomerSlim <\/em>are optional, so leaving out empty values has no effect on the JSON data size.<\/p>\n<p>Our last optimization is the serialization of an array. <strong>By serializing <em>CustomerSlim<\/em> to an array, we achieve our best result: 34.2% of the original size and 14.2% with <em>gzip<\/em>.<\/strong> So even without compression, we remove nearly two-thirds of the original data. And compression shrinks our JSON data to just one-seventh of the original size!<\/p>\n<h2  data-id=\"conclusion-1\">9. Conclusion<\/h2>\n<div class=\"bd-anchor\" id=\"conclusion-1\"><\/div>\n<p>In this article, we first saw why we need to reduce JSON data sizes. Next, we learned various ways to reduce this JSON data size. Finally, we learned how to further reduce JSON data size with a domain model that&#8217;s custom to one front-end.<\/p>\n<p>The complete code is available, as always, <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/github.com\/eugenp\/tutorials\/tree\/master\/json\">over on GitHub<\/a>.<\/p>\n<p>The post <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/json-reduce-data-size\/\" >Reducing JSON Data Size<\/a> first appeared on <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/\" >Baeldung<\/a>.<\/p>\n<p><Img align=\"left\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" style=\"border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;\" hspace=\"0\" src=\"https:\/\/feeds.feedblitz.com\/~\/i\/635831568\/0\/baeldung\"><\/p>\n<div style=\"clear:both;padding-top:0.2em;\"><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Share on Google+\" href=\"https:\/\/feeds.feedblitz.com\/_\/30\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/googleplus20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/635831568\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2020%2F09%2FJSON-generation.png\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/json-reduce-data-size#respond\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&#160;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/json-reduce-data-size\/feed\/\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>&#160;<\/div>\n\n<p class=\"syndicated-attribution\"><figure class= \\\"wp-block-image alignnone \\\"><img src= \\\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/05\/logo2-2.png\\\" alt=\\\"IT\u96fb\u8166\u88dc\u7fd2 java\u88dc\u7fd2 \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b, PHP\u88dc\u7fd2,CSS\u88dc\u7fd2,XML,Java\u88dc\u7fd2,MySQL\u88dc\u7fd2,graphic design\u88dc\u7fd2,\u4e2d\u5c0f\u5b78ICT\u88dc\u7fd2,\u4e00\u5c0d\u4e00\u79c1\u4eba\u88dc\u7fd2\u548cFreelance\u81ea\u7531\u5de5\u4f5c\u914d\u5c0d\u3002\\\"\/><figcaption>\u7acb\u523b\u8a3b\u518a\u53ca\u5831\u540d\u96fb\u8166\u88dc\u7fd2\u8ab2\u7a0b\u5427!<\/figcaption><\/figure>\r\n<\/br>Find A Teacher Form:\r\n<\/br>https:\/\/docs.google.com\/forms\/d\/1vREBnX5n262umf4wU5U2pyTwvk9O-JrAgblA-wH9GFQ\/viewform?edit_requested=true#responses\r\n<\/br><\/br>Email:\r\n<\/br>public1989two@gmail.com<br><br><br><br><br><br><br>\r\n<a href=www.itsec.hk style=color:#FFFFFF;>www.itsec.hk<\/a><br>\r\n<a href=\\\"www.itsec.vip\\\" style=color:#FFFFFF;>www.itsec.vip<\/a><br>\r\n<a href=\\\"www.itseceu.uk\\\" style=color:#FFFFFF;>www.itseceu.uk<\/a><br><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>In this tutorial, we&#8217;ll look at various ways of reducing the size of JSON in our Java applications.<\/p>\n<p>The post <a rel=\"NOFOLLOW noopener noreferrer\" href=\"https:\/\/feeds.feedblitz.com\/~\/635831568\/0\/baeldung~Reducing-JSON-Data-Size\/\" target=\"_blank\">Reducing JSON Data Size<\/a> first appeared on <a rel=\"NOFOLLOW noopener noreferrer\" href=\"https:\/\/www.baeldung.com\/\" target=\"_blank\">Baeldung<\/a>.<\/p>\n<div><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\"><\/a>&nbsp;<a title=\"Share on Google+\" href=\"https:\/\/feeds.feedblitz.com\/_\/30\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/googleplus20.png\"><\/a>&nbsp;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/635831568\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2020%2F09%2FJSON-generation.png\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\"><\/a>&nbsp;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\"><\/a>&nbsp;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\"><\/a>&nbsp;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/635831568\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\"><\/a>&nbsp;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/json-reduce-data-size#respond\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&nbsp;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/json-reduce-data-size\/feed\/\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>&nbsp;<\/div>\n<\/div>","protected":false},"author":895,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Reducing JSON Data Size - ITTeacherITFreelance.hk","description":"In this tutorial, we'll look at various ways of reducing the size of JSON in our Java applications. The post Reducing JSON Data Size first appeared on Baeldung"},"footnotes":""},"categories":[6],"tags":[5393],"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/79885"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/895"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=79885"}],"version-history":[{"count":8,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/79885\/revisions"}],"predecessor-version":[{"id":83111,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/79885\/revisions\/83111"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=79885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=79885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=79885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}