mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-12 13:28:55 +00:00
fix(building-passport): don't cache property-meta fetch
getPropertyMeta self-fetched /api/property-meta with revalidate:60 (despite a comment saying it shouldn't cache). Vercel's Data Cache served a stale response from before the headline backfill, so the current EPC rating / SAP rendered blank on the plans and plan-detail pages even though the API now returns them. Use cache:"no-store" so backfilled headline values propagate immediately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a184127cd4
commit
e1d56cc773
1 changed files with 4 additions and 2 deletions
|
|
@ -242,11 +242,13 @@ export async function getPropertyMeta(
|
|||
): Promise<PropertyMeta> {
|
||||
const url = process.env.URL + `/api/property-meta/${propertyId}`;
|
||||
|
||||
// Note, for the moment, we don't cache the data
|
||||
// Don't cache: property meta (incl. headline SAP/EPC, which is now backfilled
|
||||
// from the baseline table) changes as the modelling pipeline writes data, and
|
||||
// a stale Data Cache entry was causing the current rating to render blank.
|
||||
const response = await fetch(url, {
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
next: { revalidate: 60 },
|
||||
cache: "no-store",
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue