From 31542e19e2c15c531d54c4e66d83b3e842a82009 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 23 Sep 2023 07:11:51 +0000 Subject: [PATCH] add cache fixer :3 --- p/server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/p/server.js b/p/server.js index 758e062a..739b3a58 100644 --- a/p/server.js +++ b/p/server.js @@ -76,7 +76,7 @@ const proxy = async (req, res) => { console.log(`==> Proxying request`); - let f = await fetch(url, { + let f = await fetch(url + `?cachefixer=${btoa(Date.now())}`, { method: req.method, }); @@ -101,6 +101,8 @@ const apiUrl = "https://returnyoutubedislikeapi.com/votes?videoId="; const cache = {}; app.get('/api', async (req, res) => { + +try { const cacheKey = req.query.v; // Check if the result is already cached @@ -121,6 +123,10 @@ app.get('/api', async (req, res) => { }; res.json({ data: engagement, cachedDate: new Date() }); + +} catch { + +} });