Skip to content

Commit 59ae0e5

Browse files
committed
change
1 parent 16fb5cc commit 59ae0e5

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

frontend/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ COPY . .
2424

2525
RUN corepack enable pnpm && pnpm run build
2626

27+
COPY .next/cache/fetch-cache/ .next/standalone/.next/cache/fetch-cache/
28+
2729
FROM base AS runner
2830
WORKDIR /app
2931

frontend/next.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ module.exports = withSentryConfig({
2222
localeDetection: false,
2323
},
2424
trailingSlash: false,
25-
cacheHandler: require.resolve("./cache-handler.js"),
26-
cacheMaxMemorySize: 0, // disable default in-memory caching
25+
cacheHandler:
26+
process.env.NODE_ENV === "production"
27+
? require.resolve("./cache-handler.mjs")
28+
: undefined,
29+
cacheMaxMemorySize: 0,
30+
experimental: {
31+
instrumentationHook: true,
32+
},
2733
async headers() {
2834
return [
2935
{

frontend/src/instrumentation.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export async function register() {
2+
if (process.env.NEXT_RUNTIME === "nodejs") {
3+
const { registerInitialCache } = await import(
4+
"@neshca/cache-handler/instrumentation"
5+
);
6+
7+
const CacheHandler = (await import("../cache-handler.mjs")).default;
8+
await registerInitialCache(CacheHandler);
9+
}
10+
}

0 commit comments

Comments
 (0)