add cache interceptor for hot endpoints
deploy to danak / build_and_deploy (push) Has been cancelled
deploy to danak / build_and_deploy (push) Has been cancelled
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user