Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage compression #50

Open
ocombe opened this issue Dec 17, 2014 · 11 comments
Open

Storage compression #50

ocombe opened this issue Dec 17, 2014 · 11 comments
Assignees
Milestone

Comments

@ocombe
Copy link
Collaborator

ocombe commented Dec 17, 2014

We should offer a plugin to enable storage compression (see this article and this lib for examples).

@ocombe ocombe added this to the 2.0.0 milestone Dec 17, 2014
@rpannell
Copy link

When I was using local storage directly and before I found angular-localforage I was using that compression. Worked very well, but there was a small slow down.

It good 2.9 mb of data down to 0.16mb. So a huge difference!

@ocombe
Copy link
Collaborator Author

ocombe commented Dec 18, 2014

Wow that's huge, it could really be a good feature. You were using "pako" ?
The slow down is expected, and that's why it will be optional.

@mavrick
Copy link

mavrick commented Feb 17, 2015

+1 for lzstring

@JobaDiniz
Copy link

+1
Is there any news on this one?

@ocombe
Copy link
Collaborator Author

ocombe commented May 17, 2015

Not much, I don't have a lot of free time for now, but if you want to try to do that and do a PR, feel free to do so :)

@ocombe ocombe closed this as completed Mar 26, 2016
@scotttrinh
Copy link
Owner

Let's put this back in the queue for 1.4.0.

@scotttrinh scotttrinh reopened this Jun 27, 2016
@scotttrinh scotttrinh modified the milestones: 1.4.0, 2.0.0 Jun 27, 2016
@scotttrinh scotttrinh self-assigned this Jun 27, 2016
@siddo420
Copy link

+1
any updates on this issue?

@scotttrinh
Copy link
Owner

nothing new to report, but it is definitely on the road map. PRs welcome!

@scotttrinh
Copy link
Owner

Quick question for those who would want to use this functionality: what about making a custom localForage driver that does this compression? That would keep our codebase cleaner by still just wrapping localForage and would help the upstream community. The downside is that we'd be subject to localForage's opinions and timeframes.

@scotttrinh
Copy link
Owner

Or maybe a separate compression decorator that just wraps the getItem/setItem calls to compress and decompress on the way in and out?

@scotttrinh
Copy link
Owner

scotttrinh commented Oct 24, 2016

Here is an example decorator using LZString:

http://plnkr.co/edit/r0tSMFNJwsbyUdLT35Or?p=preview

Not cut-n-paste production ready, but is a good starting point for those wishing to do this. Maybe we can just document this pattern and be done with it?

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

No branches or pull requests

6 participants