Skip to content

debug #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

debug #158

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/shirt-shop/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ export const config = {
export async function middleware(request: NextRequest) {
const stableId = await getStableId();
const cartId = await getCartId();
const before = performance.now();
const code = await precompute(productFlags);
const after = performance.now();
console.log('initial precompute time', after - before);

const before1 = performance.now();
await precompute(productFlags);
const after1 = performance.now();
console.log('subsequent precompute time', after1 - before1);

// rewrites the request to the variant for this flag combination
const nextUrl = new URL(
Expand Down
Loading