Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Compressing HTML resource on CouchDB when transmitting wirelessly to an Android device #953

Open
kanishk1010 opened this issue Jul 24, 2017 · 3 comments

Comments

@kanishk1010
Copy link
Member

kanishk1010 commented Jul 24, 2017

The Take Home Android app requests and loads HTML resources from the BeLL-Apps server wirelessly. Since there are hundreds of files (attachments) associated with an HTML resource (app), it's a huge payload which results in very slow loading on the Android app. One way to tackle this would be to compress the files ( CouchDB attachments and metadata) into a single archive, when a particular resource is requested by an Android device. To make this happen, we would probably need to have an interface in the Bell-App which allows execution of this operation on a particular CouchDB resource on demand.

Note: One of the potential solutions I came across is an npm package called couchdb-dump which enables to perform compression,archiving and migration of CouchDB database.

@leomaxi
Copy link
Member

leomaxi commented Jul 25, 2017

This issue is linked to open-learning-exchange/take-home#63 .. On take-home issue log..
We are working towards moving documents (not database) from couchdb on raspberry pi to android device..

@alexkarasik
Copy link
Member

@kanish1010 What do you think of this plugin: https://github.com/oreinecke/couch-gzip?

@sente
Copy link
Member

sente commented Jul 26, 2017

Since there are hundreds of files (attachments) associated with an HTML resource (app)

Should we be concatenating/minifying the resources?

possibly relevant: https://github.com/open-learning-exchange/BeLL-Apps/blob/dev/app/minify_html.py

Perhaps we should look into webpack, (which supports images: https://survivejs.com/webpack/loading/images/)

@kanish1010 What do you think of this plugin: https://github.com/oreinecke/couch-gzip?

The known limitations/issues make me nervous about this. Crashing for large responses, 100ms+ for every response, no SSL...

I think using nginx in front of couchdb would do the trick, see: http://nginx.org/en/docs/http/ngx_http_gzip_module.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants