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
565452d4a8
commit
237df0993b
1 changed files with 8 additions and 8 deletions
|
|
@ -26,14 +26,14 @@ export default function handleRequest(
|
|||
// 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();
|
||||
// if (diff < 5000) {
|
||||
// // if it's less than 5 seconds old, return the cached response
|
||||
// responseHeaders.set('Content-Type', 'text/html');
|
||||
// return new Response(cachedResponse.html, {
|
||||
// headers: responseHeaders,
|
||||
// status: responseStatusCode,
|
||||
// });
|
||||
// }
|
||||
if (true || diff < 5000) {
|
||||
// if it's less than 5 seconds old, return the cached response
|
||||
responseHeaders.set('Content-Type', 'text/html');
|
||||
return new Response(cachedResponse.html, {
|
||||
headers: responseHeaders,
|
||||
status: responseStatusCode,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue