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

capacity does not work on often reload #179

Closed
Delagen opened this issue May 15, 2015 · 9 comments
Closed

capacity does not work on often reload #179

Delagen opened this issue May 15, 2015 · 9 comments
Assignees

Comments

@Delagen
Copy link

Delagen commented May 15, 2015

capacity setted to 10
cache.keys().length = 135

on every page reload it requests resource and put into cache
this code does not work because $$lruHeap.size() equals to 1

 if ($$lruHeap.size() > this.$$capacity) {
                this.remove($$lruHeap.peek().key);
              }

so capacity does not remove old items if they does not expire

@jmdobry
Copy link
Owner

jmdobry commented May 15, 2015

What does often reload mean?

@Delagen
Copy link
Author

Delagen commented May 18, 2015

Page reload. So every time cache initialized again.

@jmdobry
Copy link
Owner

jmdobry commented May 18, 2015

I need to see your entire cache configuration. Code examples please. Version please. Even better, a plunker that demonstrates the issue. Details!

@Delagen
Copy link
Author

Delagen commented May 29, 2015

capacity:10
maxAge: week
storageMode:localstorage

on every page load http get: request?random puts on the cache

so if i make 1000 loads it make 1000 entries in localstorage

@jmdobry
Copy link
Owner

jmdobry commented Sep 15, 2015

Could you please fork this plunker and demonstrate the issue? http://plnkr.co/edit/RXWGpYqRAfKPS6R38MXs?p=preview

@Delagen
Copy link
Author

Delagen commented Sep 15, 2015

Refresh result and see as keys count exceed capacity
http://plnkr.co/edit/6zyAvLYTDeHJSbCvUllF?p=preview

@jmdobry
Copy link
Owner

jmdobry commented Sep 15, 2015

Indeed it does.

@jmdobry jmdobry self-assigned this Sep 15, 2015
@jmdobry
Copy link
Owner

jmdobry commented Oct 13, 2015

Can you try 4.4.0 and see if it works better?

@Delagen
Copy link
Author

Delagen commented Oct 13, 2015

You can try the same plunker. Result the same.

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

2 participants