React Forum
Blog & Guide Responses
Jan 25, 2023 · 04:00 PM

[Guide] Build a Weather App (Cache Bypass Default) - implementation notes

Started by Keira Santos
guideweathercache bypassfreshness posturestored derived summariesuseRenderFetchevidencefavorites

The Weather App guide is a clean example of treating freshness as a route contract: cache bypass by default, visible lane markers, and stored derived summaries (now bundle, hourly strip, daily cards, alerts) so switching panels/locations is instant even while data is streaming in. I'm curious how people balance "always fresh" posture with UI stability and debuggability.

Read the guide

Did you keep cacheLane=bypass as the default, or did you introduce caching for specific panels/locations? How far did you go with stored derived outputs (cards/strips/feels-like bundles) before it became hard to keep derivations correct? What evidence do you render so a screenshot can explain *which* location/panel/lane the user is in? If you have favorites and duplicate reads (list + detail), what is your merge rule when the reads disagree?

Comments (16)

Back to latest
Marisol Vega
Jan 29, 2023 · 08:10 PM

Bypass-by-default made the app feel honest.

But we still had to make the lane visible or it just felt like the UI was randomly changing.

Dmitri Kline
Feb 08, 2023 · 07:30 AM

Storing derived cards was worth it because multiple panels read the same shape.

We had one helper that writes cards[locationId] and a lastDerivedAtByLocation evidence timestamp.

Grace McCoy
Feb 18, 2023 · 03:03 AM

Counterpoint: bypass-by-default can create churn if your API updates frequently.

We used route posture to switch to cache for hourly when the user is just browsing historical-ish data.

Keira Santos
Feb 22, 2023 · 06:18 PM

Same. The guide's key idea is that posture is explicit, not that bypass is morally correct.

If you choose cache for a panel, render data-cache-lane=cache and it's still debuggable.

Jasper Nguyen
Mar 07, 2023 · 09:12 AM

We rendered evidence on the shell: data-location, data-panel, data-cache-lane, data-render-cadence.

It made screenshots actionable immediately.

Nina Kapoor
Mar 25, 2023 · 04:44 AM

A small derive helper for the "feels like" bundle kept our UI consistent:

ts
function deriveFeelsLike(now: any) {
  return { tempC: now.tempC, windKph: now.windKph, feelsLikeC: now.tempC - 1 };
}

Even if the math is fake, having a stable derived shape matters for coherence.

Camille Duarte
Apr 12, 2023 · 09:21 PM

Favorites in a vault were nice because it made the list route and detail route agree.

If favorites live in component state, the app feels inconsistent across navigation.

Owen Price
May 01, 2023 · 05:05 AM

Merge rule for duplicate reads: we store forecastRevision per location and only apply newer reads.

Without it, you get that annoying flip where the UI seems to go backward.

Benji Rios
May 21, 2023 · 06:40 PM

A misunderstanding I had: I assumed "stored derived" was a performance trick.

In this guide it's more about stable UI contracts and debuggability than speed.

Lina Ortega
Jun 18, 2023 · 11:11 AM

Docs tie-in: this is basically the data fetching posture + a route contract story for freshness.

Related: Data Fetching and Caching (Best Practices) and Performance and Rendering (Best Practices).

Amina Farouk
Jul 11, 2023 · 02:10 AM

We kept panel in global route state (now|hourly|daily) and it made the app feel coherent.

Without it, you end up with panels that don't match the URL and back/forward becomes weird.

Sofia Valdez
Aug 08, 2023 · 04:04 AM

Counterpoint: storing hourly strips can get large and make memory usage weird on long sessions.

We stored a derived summary strip (coarser) and kept the raw list only in the forecast payload.

Dmitri Kline
Aug 11, 2023 · 07:19 PM

That seems right. Derived state should be the render-ready shape, not a second copy of raw data.

If it's too big, your derived shape isn't a summary anymore.

Theo Bennett
Sep 12, 2023 · 12:12 PM

We also rendered a data-freshness-at timestamp to avoid arguments about whether the UI updated.

It's a tiny piece of evidence that saves a lot of time.

Rowan Pierce
Oct 29, 2023 · 06:06 AM

We let cache lane switch based on battery saver mode (warm cadence, cache lane cache).

Explicit posture made it feel like a feature rather than a bug.

Priya Liao
Dec 03, 2023 · 03:33 AM

If you store derived summaries, centralize writes or you'll forget to re-derive on some mutation path.

We treat derive as mandatory after any forecast write.

Tomas Rivera
Dec 18, 2023 · 10:22 PM

We used the same evidence posture for alerts: store a derived alertSummary string and render it in the header.

Users care more about the summary than the raw payload.

Salma Qureshi
Dec 29, 2023 · 09:09 AM

The guide is a good reminder that "fresh" isn't a vibe. It's a posture you can encode and render.