From e7f3a5c488eadc381503404b8cb6e41ca58df27b Mon Sep 17 00:00:00 2001 From: Ru Chern Chong Date: Thu, 2 Nov 2023 17:30:41 +0800 Subject: [PATCH] Add cache no-store on fetch API --- lib/getCarRegistrationByMake.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/getCarRegistrationByMake.ts b/lib/getCarRegistrationByMake.ts index ce66195..2cf1102 100644 --- a/lib/getCarRegistrationByMake.ts +++ b/lib/getCarRegistrationByMake.ts @@ -6,7 +6,9 @@ import type { Car } from "@/types"; export const getCarRegistrationByMake = async ( filePath: string, ): Promise => { - const csvContent: string = await fetch(filePath).then((res) => res.text()); + const csvContent: string = await fetch(filePath, { cache: "no-store" }).then( + (res) => res.text(), + ); const carRegistrationByMake: Car[] = d3.csvParse(csvContent, (car: Car) => ({ ...car, number: +car.number,