nodejs / undici

An HTTP/1.1 client, written from scratch for Node.js
https://nodejs.github.io/undici
MIT License
6.26k stars 545 forks source link

use node:sqlite in cache api #3543

Open KhafraDev opened 2 months ago

KhafraDev commented 2 months ago

The web cache api that builds off of fetch primitives would massively benefit from persistent storage. In the past we've discussed caching via files on device, but I think either web storage or node:sqlite could lead to a more reliable approach.

metcoder95 commented 2 months ago

It would be nice, shall we do this right away (given that node:sqlite is experimental) or enable/disable it somehow through a flag and mark it as experimental?

KhafraDev commented 2 months ago

I was thinking of adding adapters similar to the dispatcher api that would let people add their own storage mechanisms. I think a built-in sqlite one would be a good start.