Skip to content

self.__next_f.push in Next.js HTML: what the RSC payload is

What self.__next_f.push scripts are in Next.js HTML, why your text appears twice, how the RSC payload counts toward Googlebot's 2 MB limit and how to shrink it.

By Crawlito · 8 min read

In short

  • The self.__next_f.push scripts in App Router HTML carry the React Server Component payload, which Next.js says ships with the HTML on the initial load so React can reconcile and hydrate the page.
  • Next.js documents that the RSC payload contains the rendered result of Server Components and any props passed to Client Components, so visible text and passed data appear a second time inside script tags.
  • Google treats pages as duplicates when separate pages have the same or very similar primary content; the payload is a copy inside one page, not a second URL.
  • Googlebot reads the first 2 MB of uncompressed HTML, and inline payload scripts count toward that limit because they are part of the HTML file.
  • The main lever for a smaller payload is passing fewer and smaller props to Client Components; in the Pages Router the equivalent is trimming NEXT_DATA, which Next.js warns about above 128 kB.
On this page

The self.__next_f.push(...) scripts you see when you view source on a Next.js App Router page are the React Server Component (RSC) payload. Next.js renders your Server Components into this serialized format, uses it to prerender the HTML, and then inlines it in the same response so React in the browser can match the HTML to the component tree and hydrate it. Your text appears twice because the payload contains the rendered output of your Server Components and every prop passed to a Client Component. It is not a duplicate page, but it is real weight in the HTML, and that weight counts toward Googlebot's 2 MB fetch limit.

This post explains what the payload contains, how to measure it on your own pages, and how to shrink it. For the general 2 MB limit and the other causes of oversized HTML, see the Googlebot file size limit. For the wider Next.js picture (Suspense, streamed metadata, robots.ts), see Next.js SEO for AI crawlers.

What self.__next_f.push actually is

The Next.js docs on Server and Client Components describe the RSC payload as "a compact, serialized representation of the rendered React Server Components tree." They list what it contains:

  • The rendered result of Server Components.
  • Placeholders for where Client Components should be rendered, and references to their JavaScript files.
  • Any props passed from a Server Component to a Client Component.

On the first load, the browser uses three things in order: the HTML to show a fast, non-interactive preview, the RSC payload to reconcile the Client and Server Component trees, and JavaScript to hydrate the Client Components. The server and client boundary guide is explicit that "On the initial load, the RSC Payload ships with the HTML." On later client-side navigations, the streaming guide says only the payload is fetched, with an rsc: 1 request header, and no HTML is transferred.

In the HTML, the payload arrives as a series of inline scripts. A real page looks something like this, shortened:

html
<script>(self.__next_f=self.__next_f||[]).push([0])</script>
<script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"/_next/static/chunks/...js\"\n..."])</script>
<script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"docs\",\"\"],..."])</script>

The first script creates a global array. Each later script pushes a chunk of the serialized tree onto it, and React reads the chunks when its JavaScript loads. The streaming guide's own chunk-by-chunk example labels one chunk as the "Component payload (self.__next_f.push) for hydration." The exact row format is internal to React and Next.js and is not documented as a stable format, so do not write tools that depend on it. If you want to see how it decodes, the streaming guide links to the RSC Explorer.

The Pages Router version: NEXT_DATA

If your site uses the Pages Router, you will see a single <script id="__NEXT_DATA__" type="application/json"> instead. The large page data message says the Pages Router serializes page data as __NEXT_DATA__ JSON, which the client must parse before hydrating, and that the data from getStaticProps, getServerSideProps or getInitialProps is "inlined in every HTML response." The same page says the App Router "streams data via Server Components and is not affected" by that warning, and Next.js does not document an equivalent size warning for the App Router payload.

App RouterPages Router
What you see in sourceMany self.__next_f.push([...]) scriptsOne <script id="__NEXT_DATA__">
What it containsRendered Server Component output, Client Component references, props to Client ComponentsReturn value of the data-fetching function
Built-in size warningNone documentedWarning above 128 kB, set by experimental.largePageDataBytes
How to shrink itPass less across the server and client boundaryReturn fewer fields from the data function

Why your text appears twice in the HTML

Because both copies are needed for different jobs. The HTML is what the browser paints and what a crawler that does not run JavaScript reads. The payload is what React uses to rebuild the component tree without re-running your Server Components in the browser. Server Component code never ships to the browser, so React needs their rendered output in data form.

So a paragraph rendered by a Server Component shows up once as a <p> in the document and again as a string inside a self.__next_f.push call. A Client Component's props show up only in the payload if the component does not render them, which is where unexpected bulk comes from: a product card that receives a full database record but displays three fields still puts every field into the HTML.

Is that duplicate content? Not in the sense Google uses the term. Google's canonicalization documentation describes duplicates as multiple pages that seem to be the same or have very similar primary content, which Google clusters together. The payload is a script inside one URL, not a second page. The two costs worth caring about are page weight and, if you pass sensitive fields, exposure: the boundary guide warns that "Props are serialized and sent to the browser."

Whether AI crawlers read text out of <script> contents when they extract a page is not documented by OpenAI, Anthropic or Perplexity at the time of writing. Do not count on the payload as a backup copy of your content. Make sure the visible HTML is complete, which is the copy every crawler can use. Raw versus rendered HTML explains why that first response is what matters.

How the payload counts toward Googlebot's 2 MB limit

Google's Googlebot documentation says Googlebot crawls the first 2 MB of a supported file type, that the limit applies to uncompressed data, and that each resource referenced in the HTML, such as CSS and JavaScript files, is fetched separately under its own limit. Inline scripts are not separate files. Every byte of self.__next_f.push counts toward the page's 2 MB.

To get a sense of scale, we fetched https://nextjs.org/docs on 15 November 2026. The uncompressed HTML was about 449 KB, and the inline __next_f scripts made up about 324 KB of it, roughly 72%. That page is nowhere near 2 MB, and a docs landing page is not typical of every site, but it shows the payload can easily be the largest thing in a Next.js document.

Where the payload sits matters as much as how big it is. On that page the payload scripts came after the main markup, so on a page that crossed the limit, the payload would be cut before the visible text. Streaming changes the order. In the streaming guide's example, a payload chunk is sent right after the static shell, and each later chunk carries more payload next to the hidden <div hidden id="S:0"> block that holds resolved Suspense content. If a large payload is followed by late Suspense content holding your main text, that text is the part most likely to land past the cutoff. Suspense placement is covered in the Next.js guide.

How to measure the RSC payload on your page

Fetch the production HTML, uncompressed, and add up the inline payload scripts. This script works for both routers:

python
# rsc-size.py: report inline RSC payload and __NEXT_DATA__ size
import re, sys, urllib.request

req = urllib.request.Request(sys.argv[1], headers={"Accept-Encoding": "identity"})
raw = urllib.request.urlopen(req).read()
html = raw.decode("utf-8", "replace")
total = len(raw)

rsc = re.findall(r"<script[^>]*>(\(?self\.__next_f.*?)</script>", html, re.S)
rsc_bytes = sum(len(s.encode("utf-8")) for s in rsc)
nd = re.search(r'<script id="__NEXT_DATA__"[^>]*>(.*?)</script>', html, re.S)
nd_bytes = len(nd.group(1).encode("utf-8")) if nd else 0

print(f"HTML total:          {total:>10,} bytes")
print(f"RSC payload scripts: {rsc_bytes:>10,} bytes in {len(rsc)} scripts")
print(f"__NEXT_DATA__:       {nd_bytes:>10,} bytes")
print(f"First payload byte:  {raw.find(b'self.__next_f'):>10,}")

Run it with python3 rsc-size.py https://example.com/products/widget. Requesting identity encoding means the byte count is the uncompressed size Google's limit uses.

Then find out what is in it. Pick a field you suspect, such as an internal ID, a long description you do not display, or a review array, and search for it:

bash
curl -s --compressed https://example.com/products/widget -o page.html
grep -o 'self.__next_f.push' page.html | wc -l      # number of payload chunks
grep -b -o 'warehouseLocation' page.html | head      # a field the page never shows
grep -b -o '<div hidden id="S:[0-9]*"' page.html     # where streamed Suspense blocks start

grep -b prints byte offsets, so you can see whether the streamed blocks start after a large stretch of payload. In the Pages Router, the large page data doc suggests running JSON.parse(document.getElementById("__NEXT_DATA__").textContent) in the browser console to inspect the whole object.

How to shrink the payload

You cannot remove the payload from App Router HTML: Next.js does not document an option for that, and hydration depends on it. You can control how much goes into it.

  1. Pass only the fields a Client Component renders. This is the biggest lever. The data security guide recommends returning "safe, minimal Data Transfer Objects" and shows a full userData record passed to a Client Component as a mistake that "exposes all the fields." The same fix cuts bytes.

    tsx
    // Before: the whole record goes into the payload
    <ProductCard product={product} />
    
    // After: only what the card displays
    <ProductCard name={product.name} price={product.price} image={product.image} />
  2. Keep non-interactive parts in Server Components. A Server Component's rendered output still goes into the payload, but its props and data do not. A Client Component that receives a large array to render a static list sends the array, then renders it. Render the list on the server and pass only the interactive piece down.

  3. Paginate long lists. A category page with 500 products carries 500 products in the HTML and again in the payload. Render a page of results with crawlable links to the next page. If you use query parameters for pagination or filters, watch how they interact with client navigation; see RSC query URLs in Googlebot logs.

  4. Do not move content to the browser to save bytes. The large page data doc suggests fetching non-critical data on the client after hydration. That is fine for widgets nobody needs to cite, but text fetched in the browser is missing from the first HTML response for crawlers that do not run JavaScript. The same trap appears when a hook forces client rendering, as in the useSearchParams bailout.

  5. In the Pages Router, trim the data function's return value and only raise largePageDataBytes after checking the trade-off, as the Next.js docs advise.

After each change, run the measurement again and record the total, the payload bytes and the offset of your main heading.

Frequently asked questions

What is self.__next_f in Next.js?

It is a global array that Next.js App Router pages use to deliver the React Server Component payload inline in the HTML. Each self.__next_f.push script adds a chunk of the serialized component tree, which React reads to hydrate the page.

Is the RSC payload duplicate content for SEO?

No. Google describes duplicates as separate pages with the same or very similar primary content, and the payload is a script inside one page. Its practical costs are page weight and any data you did not mean to publish.

Can I turn off the RSC payload in the HTML?

Next.js does not document a way to omit it from App Router HTML, because React needs it to hydrate. Reduce it by passing fewer and smaller props to Client Components.

Do AI crawlers read text inside the self.__next_f scripts?

None of the major AI crawler operators document how they treat text in script contents at the time of writing. Rely on the visible HTML, which every crawler that fetches the page receives.

Does the payload count toward Googlebot's 2 MB limit?

Yes. Google applies the 2 MB limit to the uncompressed HTML file, and inline scripts are part of that file. Resources referenced from the HTML, such as external CSS and JavaScript files, are fetched separately under their own limit.

Check what your Next.js page sends

Run the measurement above on your heaviest templates first: long listings, product pages and anything that passes large records to Client Components. To look at one page without writing code, the free check runs on a single URL with no account needed. If payload weight or late Suspense content is a problem across many templates, an audit covers up to 500 pages and comes back as a PDF with evidence and prioritized fixes.

Filed under Rendering and content. Topics: nextjs, react, raw-html, html, rendering