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

Clear cache on zoom change #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

henryptung
Copy link
Contributor

This is somewhat more questionable and not necessarily something you want to merge into master, but I noticed that with significant panning and zooming over time, the UtfGrid layer developed a very large cache of all tiles ever fetched. This adds a zoomend handler that, on zoom change, deletes cache entries that don't match the current zoom, to minimize memory usage at runtime.

As a tradeoff, this means that zooming to level A, B, then back to A will cause tiles to reload from backend whereas they previously did not. Up to you on whether you think it's important.

@henryptung henryptung force-pushed the clear-cache-on-zoom-change branch from dcb9ea4 to 39028cc Compare August 12, 2015 05:57
@henryptung henryptung force-pushed the clear-cache-on-zoom-change branch from 39028cc to a4a638f Compare August 12, 2015 06:00
@danzel
Copy link
Owner

danzel commented Aug 14, 2015

Hrm ok thanks.
Maybe we want to have a LRU cache instead.

@henryptung
Copy link
Contributor Author

So, I realized that I hadn't cleaned up my shapefile before loading, so I was getting a LOT of large metadata cruft on the frontend in a lot of tiles. The burden got significantly lighter once I stopped doing that, so I don't think this is nearly as important. Up to you on whether you want to merge, keep around a branch, or close out (it's still listed under pull requests, anyway).

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