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

Tile caching behavior in OL@10 #71

Open
itspangler opened this issue Nov 29, 2024 · 6 comments
Open

Tile caching behavior in OL@10 #71

itspangler opened this issue Nov 29, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@itspangler
Copy link
Contributor

At the border of Swampscott and Lynn, two neighborhoring atlases—both Hopkins 1880—load at the same time:

Screenshot 2024-11-29 at 11 11 27 AM

This is a rare bug occasioned by the fact that two different atlases by the same publisher and from the same year appear within the same view. Need to look at the volumes file and figure out how to ensure they don't both appear when one is selected.

@itspangler itspangler added the bug Something isn't working label Nov 29, 2024
@garrettdashnelson
Copy link
Member

At a first glance, I think this is due to tile caching behavior and not to any issue with the volumes file. My first guess is that OL@10 must have introduced some new caching functions for tile layers and we probably have to wipe the cache every time we swap the source of a layer.

@itspangler
Copy link
Contributor Author

oh, i think you're right - it happens when switching any layer... maybe we can troubleshoot next week.

@itspangler itspangler changed the title "1880 Hopkins" metadata collision in Swampscott & Lynn Tile caching behavior in OL@10 Dec 5, 2024
@itspangler
Copy link
Contributor Author

possibly the clear() method detailed here? flagging so i can look later

"Remove all cached reprojected tiles from the source. The next render cycle will create new tiles."

https://openlayers.org/en/latest/apidoc/module-ol_source_XYZ-XYZ.html

@garrettdashnelson
Copy link
Member

garrettdashnelson commented Dec 10, 2024

@itspangler Just a note to say that I tried quite a few variants of flushing the cache with the .clear() method (it's technically on a TileJSON source, not an XYZ source) without any luck. My suspicion is that even if the network cache is cleared, the new OL is probably not unpainting the canvas and instead it is leaving existing tiles painted onto the canvas until they are overpainted by something else. It's possible we might have to paint out the canvas with black first, then clear cache, then switch to new TileJSON source.

@itspangler
Copy link
Contributor Author

@garrettdashnelson were you able to replicate this error locally? i made a branch for caching-bug-fix, but i couldn't replicate the behavior that i am seeing in production. also not able to replicate on staging

@garrettdashnelson
Copy link
Member

Yes, I'm able to reproduce it locally. staging is not up-to-date with the latest changes to main, so it's still not running OL@10. (I can fix that now.) You might check whether your branch is coming off of the head of main or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants