feat: добавить Image Gateway с кешем Souin
- добавлена сборка Caddy с Souin, Otter и NutsDB - добавлена конфигурация dev, prod и test Docker Compose - настроено кеширование через Otter L1 и NutsDB L2 - добавлены e2e-тесты Bun для кеша, restart и purge - добавлена документация по запуску, API кеша и тестам
This commit is contained in:
23
tests/e2e/cache-purge.test.js
Normal file
23
tests/e2e/cache-purge.test.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import {
|
||||
expectHit,
|
||||
expectStored,
|
||||
purgeAll,
|
||||
requestImage,
|
||||
waitForReady,
|
||||
} from "./helpers.js";
|
||||
|
||||
describe("cache purge", () => {
|
||||
test("flush clears cache without breaking new writes", async () => {
|
||||
await waitForReady();
|
||||
await purgeAll();
|
||||
|
||||
const miss = await requestImage(103);
|
||||
expect(miss.status).toBe(200);
|
||||
expectStored(miss.cacheStatus);
|
||||
|
||||
const hit = await requestImage(103);
|
||||
expect(hit.status).toBe(200);
|
||||
expectHit(hit.cacheStatus, "OTTER");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user