aboutsummaryrefslogtreecommitdiff
path: root/src/config/cacheControlMiddleware.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/cacheControlMiddleware.ts')
-rw-r--r--src/config/cacheControlMiddleware.ts15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/config/cacheControlMiddleware.ts b/src/config/cacheControlMiddleware.ts
deleted file mode 100644
index 47035ed..0000000
--- a/src/config/cacheControlMiddleware.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import type { MiddlewareHandler } from "hono";
-
-// Define middleware to add Cache-Control header
-const cacheControlMiddleware: MiddlewareHandler = async (c, next) => {
- const sMaxAge = process.env.ANIWATCH_API_S_MAXAGE || "60";
- const staleWhileRevalidate = process.env.ANIWATCH_API_STALE_WHILE_REVALIDATE || "30";
- c.header(
- "Cache-Control",
- `s-maxage=${sMaxAge}, stale-while-revalidate=${staleWhileRevalidate}`
- );
-
- await next();
-};
-
-export default cacheControlMiddleware;