{ "id": "63330", "key": "TIMOB-2698", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12083", "description": "", "name": "Sprint 2011-43", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-15T07:19:24.000+0000", "created": "2011-04-15T03:27:21.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "feature" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [ { "id": "15445", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "86527", "key": "TIMOB-7666", "fields": { "summary": "Android: Add gzip support in the response header for more efficient network transfer", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T22:23:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

It appears that gzip headers arent currently supported.

\r\n

xhr.setRequestHeader(\"Accept-Encoding\",\"gzip,deflate\");

\r\n

Any chance of adding this? Thx!

{html}", "attachment": [], "flagged": false, "summary": "Support for \"Accept-Encoding\",\"gzip,deflate\"", "creator": { "name": "taazza", "key": "taazza", "displayName": "Taazza", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129224", "author": { "name": "kevinwhinnery", "key": "kevinwhinnery", "displayName": "kevinwhinnery", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

\nPossibly useful thread regarding supporting gzip compression on\nAndroid.

{html}", "updateAuthor": { "name": "kevinwhinnery", "key": "kevinwhinnery", "displayName": "kevinwhinnery", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:21.000+0000", "updated": "2011-04-15T03:27:21.000+0000" }, { "id": "157012", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h3. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-292662", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-17T10:38:51.000+0000", "updated": "2011-06-17T10:38:51.000+0000" }, { "id": "159633", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Bump. Would be a nice addition in 1.8", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-07-14T20:05:21.000+0000", "updated": "2011-07-14T20:05:21.000+0000" }, { "id": "166203", "author": { "name": "taazzago", "key": "taazzago", "displayName": "Taazza GO", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Folks this feature has been requested for over 6 months now. Gzipping on a slower network is key. Any chance to add this on in 1.8?", "updateAuthor": { "name": "taazzago", "key": "taazzago", "displayName": "Taazza GO", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-15T12:32:31.000+0000", "updated": "2011-09-15T12:32:31.000+0000" }, { "id": "169558", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "Any news on this is possible?", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-10-18T09:53:37.000+0000", "updated": "2011-10-18T09:53:37.000+0000" }, { "id": "170306", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "Would like to know if this is possible.", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-10-25T06:52:43.000+0000", "updated": "2011-10-25T06:52:43.000+0000" }, { "id": "170520", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Steps to test:\r\n1. Run the snippet\r\n{code}\r\nTi.UI.backgroundColor = '#dddddd';\r\n \r\nvar url = \"https://raw.github.com/appcelerator/Documentation-Examples/master/HTTPClient/data/json.txt\";\r\nvar win = Ti.UI.createWindow();\r\nvar table = Ti.UI.createTableView();\r\nvar tableData = [];\r\nvar json, fighters, fighter, i, row, nameLabel, nickLabel;\r\n \r\nvar xhr = Ti.Network.createHTTPClient({\r\n onload: function() {\r\n // Ti.API.debug(this.responseText);\r\n \r\n json = JSON.parse(this.responseText);\r\n for (i = 0; i < json.fighters.length; i++) {\r\n fighter = json.fighters[i];\r\n row = Ti.UI.createTableViewRow({\r\n height:'60dp'\r\n });\r\n nameLabel = Ti.UI.createLabel({\r\n text:fighter.name,\r\n font:{\r\n fontSize:'24dp',\r\n fontWeight:'bold'\r\n },\r\n height:'auto',\r\n left:'10dp',\r\n top:'5dp',\r\n color:'#000',\r\n touchEnabled:false\r\n });\r\n nickLabel = Ti.UI.createLabel({\r\n text:'\"' + fighter.nickname + '\"',\r\n font:{\r\n fontSize:'16dp'\r\n },\r\n height:'auto',\r\n left:'15dp',\r\n bottom:'5dp',\r\n color:'#000',\r\n touchEnabled:false\r\n });\r\n \r\n row.add(nameLabel);\r\n row.add(nickLabel);\r\n tableData.push(row);\r\n }\r\n \r\n table.setData(tableData);\r\n },\r\n onerror: function(e) {\r\n Ti.API.debug(\"STATUS: \" + this.status);\r\n Ti.API.debug(\"TEXT: \" + this.responseText);\r\n Ti.API.debug(\"ERROR: \" + e.error);\r\n alert('There was an error retrieving the remote data. Try again.');\r\n },\r\n timeout:5000\r\n});\r\n\r\n\r\nxhr.open(\"GET\", url);\r\nxhr.setRequestHeader(\"Accept-Encoding\",\"gzip,deflate\"); \r\nxhr.send();\r\n \r\nwin.add(table);\r\nwin.open();\r\n{code}\r\n2. Run the snippet with and without this line and make sure content is identical\r\n{code}\r\nxhr.setRequestHeader(\"Accept-Encoding\", \"gzip,deflate\");\r\n{code}\r\n3. Since the json file we're getting info from is very small, you would not see performance difference, which is the main reason for gzipping. Perhaps feed in a bigger json thats 100k-200k large.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-26T10:46:13.000+0000", "updated": "2011-10-26T10:46:13.000+0000" }, { "id": "170847", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Keep up the good work on this, Hieu - it will be such a valuable addition.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-10-30T05:33:07.000+0000", "updated": "2011-10-30T05:33:07.000+0000" }, { "id": "184904", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I have evidence that this is working properly.\r\n\r\n1. Upload the following to a public folder in your Dropbox: ~/Library/Applucation\\ Support/Titanium/mobilesdk/1.8.0.1/api.jsca Dropbox supports gzip, and api.jsca is a 14mb JSON text file.\r\n2. Drop the below snippet in an app.js and try it out. On my connection, I download the file in about 1.2 seconds.\r\n3. For testing iOS, comment out gzip support in the SDK itself and try again. Also remove the setRequestHeader in your app.js. I averaged 8 seconds per download.\r\n\r\nWe can extrapolate from this that gzip is transmitting a payload 15% the size of the uncompressed version. (Results may vary depending upon the data being transmitted.)\r\n\r\n{code:title=app.js}\r\nvar start = new Date().getTime();\r\nvar client = Ti.Network.createHTTPClient({\r\n onload: function () {\r\n alert('Request loaded in ' + (new Date().getTime() - start) + 'ms.');\r\n },\r\n onerror: function () {\r\n alert('Failed!');\r\n }\r\n});\r\nclient.open('GET', 'http://dl.dropbox.com/u//api.jsca');\r\nclient.setRequestHeader('Accept-Encoding', 'gzip,deflate');\r\nclient.send();\r\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-02T12:05:55.000+0000", "updated": "2012-03-02T12:05:55.000+0000" }, { "id": "327592", "author": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "body": "it would be nice if 'Accept-Encoding: gzip,deflate' is added by default, because this is the behaviour when compiling for iOS", "updateAuthor": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-10-10T12:00:41.000+0000", "updated": "2014-10-10T12:00:41.000+0000" }, { "id": "413330", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T22:23:52.000+0000", "updated": "2017-03-16T22:23:52.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }