mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
Remove prefetch boolean from JS sources - no reason to ever not use i… (#353)
* Remove prefetch boolean from JS sources - no reason to ever not use it * JS optimization for header fetches on etag invalidation [#90] * If promises are shared between requests, only the first invalidation makes the header request. * If promises are not shared, simply delete the key. * JS 3.0.3 [#90] * update CHANGELOG
This commit is contained in:
@@ -289,12 +289,8 @@ test("cache getDirectory", async () => {
|
||||
"1"
|
||||
);
|
||||
|
||||
let cache = new SharedPromiseCache(6400, false);
|
||||
let header = await cache.getHeader(source);
|
||||
assert.strictEqual(cache.cache.size, 1);
|
||||
|
||||
cache = new SharedPromiseCache(6400, true);
|
||||
header = await cache.getHeader(source);
|
||||
const cache = new SharedPromiseCache(6400);
|
||||
const header = await cache.getHeader(source);
|
||||
|
||||
// prepopulates the root directory
|
||||
assert.strictEqual(cache.cache.size, 2);
|
||||
@@ -358,7 +354,7 @@ test("weak etags", async () => {
|
||||
// handle DigitalOcean case returning 200 instead of 206
|
||||
|
||||
test("cache pruning by byte size", async () => {
|
||||
const cache = new SharedPromiseCache(2, false);
|
||||
const cache = new SharedPromiseCache(2);
|
||||
cache.cache.set("0", { lastUsed: 0, data: Promise.resolve([]) });
|
||||
cache.cache.set("1", { lastUsed: 1, data: Promise.resolve([]) });
|
||||
cache.cache.set("2", { lastUsed: 2, data: Promise.resolve([]) });
|
||||
|
||||
Reference in New Issue
Block a user