From c9c8e775b9ef5bf5cd7ea5e6063d27d15178ca9e Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Mon, 22 Aug 2022 13:57:25 +0300 Subject: [PATCH] Adding max-age=0, for cache header --- pages/api/address.ts | 2 +- pages/api/profile.ts | 2 +- pages/api/text.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/api/address.ts b/pages/api/address.ts index 46af009..49e68c4 100644 --- a/pages/api/address.ts +++ b/pages/api/address.ts @@ -11,7 +11,7 @@ export default async function getEnsAddress( const address = await ens.name(ensName).getAddress() if (!address) throw `No address found for "${ensName}"` - response.setHeader('Cache-Control', 's-maxage=86400') + response.setHeader('Cache-Control', 'max-age=0, s-maxage=86400') response.status(200).send(address) } catch (error) { response.status(500).send(`${error}`) diff --git a/pages/api/profile.ts b/pages/api/profile.ts index ca0c181..0837e49 100644 --- a/pages/api/profile.ts +++ b/pages/api/profile.ts @@ -64,7 +64,7 @@ export default async function EnsProfileApi( const accountId = String(request.query.address) const profile = await getEnsProfile(accountId) - response.setHeader('Cache-Control', 's-maxage=86400') + response.setHeader('Cache-Control', 'max-age=0, s-maxage=86400') response.status(200).send(profile) } catch (error) { response.status(500).send(`${error}`) diff --git a/pages/api/text.ts b/pages/api/text.ts index 1ffc1cd..e642e09 100644 --- a/pages/api/text.ts +++ b/pages/api/text.ts @@ -54,7 +54,7 @@ export default async function ensTextApi( const ensName = String(request.query.name) const records = await getEnsTextRecords(ensName) - response.setHeader('Cache-Control', 's-maxage=86400') + response.setHeader('Cache-Control', 'max-age=0, s-maxage=86400') response.status(200).send(records) } catch (error) { response.status(500).send(`${error}`)