From fb5a7272dbdc400f661aac1079f5ca9af6083d21 Mon Sep 17 00:00:00 2001 From: shrotia Date: Tue, 15 Oct 2024 23:01:12 +0530 Subject: [PATCH] Update recent-articles.js --- blocks/recent-articles/recent-articles.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/recent-articles/recent-articles.js b/blocks/recent-articles/recent-articles.js index 8bb6ce6d2..2b8a2e8ec 100644 --- a/blocks/recent-articles/recent-articles.js +++ b/blocks/recent-articles/recent-articles.js @@ -32,9 +32,10 @@ export default async function decorate(block) { } // Fetch metadata if delivery URL is valid + //append current timestamp as a cache killer in the URL e.g. ${deliveryUrl}/metadata?${Date.now()} if (deliveryUrl) { try { - const response = await fetch(`${deliveryUrl}/metadata`, { + const response = await fetch(`${deliveryUrl}/metadata?${Date.now()}`, { headers: { 'If-None-Match': 'no-cache' // Set 'no-cache' to ensure the latest metadata is fetched }