Skip to content

Preconnect to checkout origin on cart page#2521

Merged
bookernath merged 1 commit intocanaryfrom
checkout-preconnect
Aug 13, 2025
Merged

Preconnect to checkout origin on cart page#2521
bookernath merged 1 commit intocanaryfrom
checkout-preconnect

Conversation

@bookernath
Copy link
Copy Markdown
Contributor

@bookernath bookernath commented Aug 13, 2025

What/Why?

On the cart page, add a preconnect tag for the checkout URL, to make sure DNS and TLS connection is already done by the time the user needs to redirect to checkout, thus improving checkout load performance for the redirected checkout.

https://nextjs.org/docs/app/api-reference/functions/generate-metadata#resource-hints

Testing

image

Migration

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 13, 2025

🦋 Changeset detected

Latest commit: ca26e6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Preview Comment Aug 13, 2025 10:31pm
catalyst-canary Ready Preview Comment Aug 13, 2025 10:31pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
catalyst ⬜️ Ignored Aug 13, 2025 10:31pm
catalyst-au ⬜️ Ignored Aug 13, 2025 10:31pm
catalyst-uk ⬜️ Ignored Aug 13, 2025 10:31pm

Copy link
Copy Markdown
Contributor

@matthewvolk matthewvolk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Just one comment to consider. Also might need to run pnpm lint -- --fix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍹 Would it be beneficial to use this anywhere else? Wondering if we generalize it CheckoutPreconnectPreconnectResource and add an optional param for options: PreconnectOptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, and I don't think so - Next.js already has great defaults for this in the rest of the application, our situation here is special because we are redirecting externally. The other place where this might be useful is in areas where you're likely to proceed directly to checkout, but this is the only place in the Catalyst codebase where this is relevant right now.

@bookernath bookernath force-pushed the checkout-preconnect branch from 0c60b9d to ca26e6b Compare August 13, 2025 22:29
@bookernath bookernath marked this pull request as ready for review August 13, 2025 22:33
@bookernath bookernath requested a review from a team August 13, 2025 22:33
@bookernath bookernath added this pull request to the merge queue Aug 13, 2025
Merged via the queue into canary with commit 6f6a8af Aug 13, 2025
13 checks passed
@bookernath bookernath deleted the checkout-preconnect branch August 13, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants