add cache interceptor for hot endpoints
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-06-04 17:04:28 +03:30
parent 0d619f313d
commit 7995ae2948
16 changed files with 165 additions and 19 deletions
@@ -0,0 +1,14 @@
/** Default TTL (seconds) for public read endpoints */
export const PUBLIC_CACHE_TTL = 300;
export const CacheKeyPrefixes = {
FOODS_BY_RESTAURANT: 'public:foods:restaurant',
CATEGORIES_BY_RESTAURANT: 'public:categories:restaurant',
RESTAURANT_SPEC: 'public:restaurants',
} as const;
export const CacheKeys = {
foodsByRestaurant: (slug: string) => `${CacheKeyPrefixes.FOODS_BY_RESTAURANT}:${slug}`,
categoriesByRestaurant: (slug: string) => `${CacheKeyPrefixes.CATEGORIES_BY_RESTAURANT}:${slug}`,
restaurantSpec: (slug: string) => `${CacheKeyPrefixes.RESTAURANT_SPEC}:${slug}`,
} as const;