Skip to content

Commit

Permalink
perf(vercel#41392): improve cache busting inject performance
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Oct 15, 2022
1 parent 59eefb2 commit 2a9beaa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/next/server/app-render.tsx
Expand Up @@ -1165,6 +1165,10 @@ export async function renderToHTMLOrFlight(
Component: () => {
let props = {}

// Add extra cache busting (DEV only) for https://github.com/vercel/next.js/issues/5860
// See also https://bugs.webkit.org/show_bug.cgi?id=187726
const cacheBustingUrlSuffix = dev ? `?ts=${Date.now()}` : ''

return (
<>
{preloadedFontFiles.map((fontFile) => {
Expand All @@ -1184,9 +1188,7 @@ export async function renderToHTMLOrFlight(
? stylesheets.map((href) => (
<link
rel="stylesheet"
// Add extra cache busting (DEV only) for https://github.com/vercel/next.js/issues/5860
// See also https://bugs.webkit.org/show_bug.cgi?id=187726
href={`/_next/${href}${dev ? `?ts=${Date.now()}` : ''}`}
href={`/_next/${href}${cacheBustingUrlSuffix}`}
// `Precedence` is an opt-in signal for React to handle
// resource loading and deduplication, etc:
// https://github.com/facebook/react/pull/25060
Expand Down

0 comments on commit 2a9beaa

Please sign in to comment.