Menu

Reuse a Cached App Shell Without Blurring Query-Driven Responses
📰

Reuse a Cached App Shell Without Blurring Query-Driven Responses

DEV Community: frontend·Chris Rodriguez·3 days ago
#25jjapW7
#devtofrontend#devto#dev#request#cache
Reading 0:00
15s threshold

A cached app shell may fail to load offline when a navigation adds a tracking or cosmetic query parameter. A request for /app and one for /app?utm_source=newsletter are different URLs under default cache matching, even when both should receive the same shell document.

The safe fix is route-scoped rather than global. First classify the request: allow only GET requests for a canonical shell path such as /app . For that one lane, use a cache lookup that ignores the URL search component. The cached shell can then satisfy navigations with campaign tags or other parameters that do not alter the shell response. The request still carries its full URL; only cache comparison changes.

Leave every other request on exact matching. API endpoints, searches, filtered results, user profiles, reports, and locale-specific content often use query parameters to select the response. In those cases, ignoring search could make one request receive a response intended for another query.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.