-
-
Notifications
You must be signed in to change notification settings - Fork 675
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Based on the numerous todo: cache comments (such as:
Line 1394 in eb884c5
| // TODO: cache |
I was reading this mdn documentation: https://developer.mozilla.org/en-US/docs/Web/API/Request/cache and trying to demo the default cache behavior with a test script like:
import http from 'node:http';
import events from 'node:events';
const server = http.createServer((req, res) => {
console.log('hello from server');
res.writeHead(200, { 'Content-Type': 'application/json', 'Cache-Control': 'max-age=604800' });
res.end(JSON.stringify({
data: 'Hello, World!'
}));
});
server.listen();
await events.once(server, 'listening');
const address = server.address();
console.log(address);
const r = await fetch(`http://localhost:${address.port}`);
await r.json();
console.log(`status ${r.status}`)
const r2 = await fetch(`http://localhost:${address.port}`);
await r2.json();
console.log(`status ${r2.status}`)
server.close();But this logs hello from server twice.
luiscastro193, styfle, danielbayley and fredericDelaporte
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request