feat(cache): implement a simple caching mechanism with TTL and prefix invalidation

refactor(expenses): integrate caching for periodic expenses and related operations
refactor(quotes): add caching for quotes retrieval and history endpoints
This commit is contained in:
Jose Selesan
2026-05-29 19:25:15 -03:00
parent 801f04df12
commit 988d58d761
9 changed files with 129 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import type { Context } from "hono";
import { prisma } from "../../../lib/prisma";
import { cache } from "../../../lib/cache";
import { logger } from "../../../lib/logger";
import { PaymentStatus } from "../../../generated/prisma/client";
@@ -113,6 +114,8 @@ export async function importExpensesHandler(c: Context) {
}
}
cache.invalidateByPrefix("expenses:");
return c.json({
imported,
skipped,