Improve vector layer loading with caching and request deduplication#364
Open
Athina09 wants to merge 17 commits intocore-stack-org:developmentfrom
Open
Improve vector layer loading with caching and request deduplication#364Athina09 wants to merge 17 commits intocore-stack-org:developmentfrom
Athina09 wants to merge 17 commits intocore-stack-org:developmentfrom
Conversation
added 17 commits
March 7, 2026 13:40
…andscape visible - Make scroll container explicit (flex layout, main scrolls only) - Use scroll-snap proximity and GPU layer for smoother scroll - Replace backdrop-blur on sections with bg-white/10 to reduce jank - Fix layout: h-screen + navbar + footer so first section shows below navbar - Add landing-scroll-container CSS (scroll-padding, -webkit-overflow-scrolling) - Semantic structure: header, main, footer with shrink-0 for stable layout Made-with: Cursor
…l-behavior, scroll-margin Made-with: Cursor
…tion Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Adds a lightweight search box to filter layers by label/name in the right sidebar, making it faster to find layers without API changes. Made-with: Cursor
…and deduplicating in-flight requests. This reduces repeated GeoJSON fetches for the same layer URL, lowers server load, and adds a force-refresh path when fresh data is needed. Made-with: Cursor
OpenLayers setStyle replaces the previous style; apply the default blue fill only when layer_store is not panchayat_boundaries. Made-with: Cursor
Dispatch VECTOR_LAYER_LOAD_ERROR_EVENT from getVectorLayers on HTTP errors, fetch failures, and invalid GeoJSON; Map listens and merges into layerErrors. Add dismiss control for the notification panel. Made-with: Cursor
Use OpenLayers vector loader callbacks so featuresloadend/error fire correctly. Remove unused url option with custom loader. Prune expired cache entries on fetch. Parse features with featureProjection like the built-in XHR loader. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
getVectorLayers fetches the same WFS/GeoJSON endpoint repeatedly when users toggle layers or revisit the same view. This causes unnecessary network calls, slower layer rendering, and extra load on GeoServer.
Proposed Enhancement
Add request-level caching and in-flight request deduplication in src/actions/getVectorLayers.js.
Scope
Cache layer responses in memory, keyed by request URL.
Add cache TTL (e.g., 5 minutes) to avoid stale data persisting forever.
Deduplicate concurrent requests so the same URL is fetched only once at a time.
Add a forceRefresh option to bypass cache when required.
Expected Outcome
Faster layer load times for repeated requests.
Reduced duplicate network traffic.
Better user experience when toggling/reopening layers.
Lower backend load from repetitive WFS calls.
Acceptance Criteria
Repeated calls to the same URL within TTL return cached data.
Concurrent requests for the same URL share one network request.
Cache expires automatically after TTL.
forceRefresh=true always fetches fresh data.
No regressions in existing layer rendering behavior.
Notes
This should be implemented in a way that is transparent to existing callers, with backward-compatible defaults.