Description
As pointed out by @ronag in #3657, we can improve our SQLite store design by using a composite cache key as the ID of the table instead of an auto increment field.
One specific problem of our SQLiteStore design is that on reading the cache, we read all the values for a given route, independently of the vary
headers:
undici/lib/cache/sqlite-cache-store.js
Lines 375 to 421 in e49b575
For similar reasons in writing, we need to first read the cache, find if we have a matching row, and the go update that.
undici/lib/cache/sqlite-cache-store.js
Lines 276 to 315 in e49b575
We should be able to fix both problems at the same time by using a primary key that includes the vary headers, so we can avoid loading everything at once during getting.
For the algorithm to compute the key, check #3657 (comment).
Activity