fix: CI build errors + simplify cache handler and data cache
- Remove `export const dynamic` from 4 routes (incompatible with cacheComponents) - Static import for redis-handler (Turbopack can't resolve relative dynamic imports) - Simplify redis-handler: Buffer.concat, NonNullable, single connect promise - Inline single-use helpers in integration-data-cache - Non-greedy SVG regex to prevent ReDoS - Inline getDevelopmentServiceAliases in next.config - Remove restating comments
This commit is contained in:
12 files changed
+79
-98
No files matched your search
@@ -1,13 +1,13 @@
|
||||
import type { CacheHandler } from "next/dist/server/lib/cache-handlers/types";
|
||||
|
||||
import { RedisCacheHandler } from "./redis-handler";
|
||||
|
||||
let handlerPromise: Promise<CacheHandler> | undefined;
|
||||
|
||||
const createHandlerAsync = async (): Promise<CacheHandler> => {
|
||||
const useRedis = process.env.REDIS_HOST || process.env.REDIS_IS_EXTERNAL === "true";
|
||||
if (useRedis) {
|
||||
const { RedisCacheHandler } = await import("./redis-handler");
|
||||
return new RedisCacheHandler();
|
||||
}
|
||||
if (useRedis) return new RedisCacheHandler();
|
||||
|
||||
const { createDefaultCacheHandler } = await import("next/dist/server/lib/cache-handlers/default");
|
||||
return createDefaultCacheHandler(32 * 1024 * 1024);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user