mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
test cache
This commit is contained in:
parent
237df0993b
commit
7dbc810f2b
1 changed files with 1 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ export default function handleRequest(
|
|||
// check if we have a cached response in memory
|
||||
const cachedResponse = cache.get(request.url);
|
||||
if (cachedResponse) {
|
||||
console.log('Serving from cache', request.url);
|
||||
// if we have a cached response, check if it's less than 5 seconds old
|
||||
const now = new Date();
|
||||
const diff = now.getTime() - cachedResponse.date.getTime();
|
||||
|
|
|
|||
Loading…
Reference in a new issue