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

Implemented image caching solution (closes #14) #19

Merged
merged 1 commit into from
Oct 2, 2015

Conversation

wilsonpage
Copy link
Contributor

No description provided.

@wilsonpage
Copy link
Contributor Author

@etiennesegonzac r?

* @private
*/
reloadData() {
this.emptyImageCache();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a test for this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth it to file follow up to add a formal way to "append" content (ie. new content bellow but the content that was there didn't move). We'll be able to do a bunch of optimizations, including not throwing away the image cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a really good idea! Filed issue #20

@etiennesegonzac
Copy link
Contributor

I nitpick because I care, but this is a really nice PR! Great job!

@wilsonpage
Copy link
Contributor Author

@etiennesegonzac ready for final review.

I added a feature to limit the imageCache by length as well as bytes. This is to prevent us storing too many strings when Blobs are not used. So by default we store up to 500images || 5mb, but this is all configurable.

* half of the cached images not currently
* in use, then we checkImageCacheLimit()
* once more.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach!

@etiennesegonzac
Copy link
Contributor

Apart from that we're good to go!

@wilsonpage
Copy link
Contributor Author

@etiennesegonzac fixed and added test to prove.

wilsonpage added a commit that referenced this pull request Oct 2, 2015
Implemented image caching solution (closes #14)
@wilsonpage wilsonpage merged commit ce4f027 into fxos-components:master Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants