You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v2/core-concepts/the-protocol.mdx
+63-9Lines changed: 63 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,15 @@ The very first request to an Inertia app is just a regular, full-page browser re
10
10
11
11
This HTML response includes the site assets (CSS, JavaScript) as well as a root `<div>` in the page's body. The root `<div>` serves as a mounting point for the client-side app, and includes a `data-page` attribute with a JSON encoded [page object](#the-page-object) for the initial page. Inertia uses this information to boot your client-side framework and display the initial page component.
12
12
13
-
```html
13
+
```http
14
+
REQUEST
15
+
GET: http://example.com/events/80
16
+
Accept: text/html, application/xhtml+xml
17
+
18
+
RESPONSE
19
+
HTTP/1.1 200 OK
20
+
Content-Type: text/html; charset=utf-8
21
+
14
22
<html>
15
23
<head>
16
24
<title>My app</title>
@@ -31,10 +39,24 @@ Once the Inertia app has been booted, all subsequent requests to the site are ma
31
39
32
40
When the server detects the `X-Inertia` header, instead of responding with a full HTML document, it returns a JSON response with an encoded [page object](#the-page-object).
You can read more about this on the [asset versioning](/v2/advanced/asset-versioning) page.
336
375
337
376
## Partial Reloads
338
377
339
378
When making Inertia requests, the partial reload option allows you to request a subset of the props (data) from the server on subsequent visits to the *same* page component. This can be a helpful performance optimization if it's acceptable that some page data becomes stale. See the [partial reloads](/v2/data-props/partial-reloads) documentation for details.
340
379
341
-
When a partial reload request is made, Inertia includes two additional headers with the request:`X-Inertia-Partial-Data` and `X-Inertia-Partial-Component`.
380
+
When a partial reload request is made, Inertia includes the `X-Inertia-Partial-Component` header and may include`X-Inertia-Partial-Data` and/or`X-Inertia-Partial-Except` headers with the request.
342
381
343
382
The `X-Inertia-Partial-Data` header is a comma separated list of the desired props (data) keys that should be returned.
344
383
384
+
The `X-Inertia-Partial-Except` header is a comma separated list of the props (data) keys that should not be returned. When only the `X-Inertia-Partial-Except` header is included, all props (data) except those listed will be sent. If both `X-Inertia-Partial-Data` and `X-Inertia-Partial-Except` headers are included, the `X-Inertia-Partial-Except` header will take precedence.
385
+
345
386
The `X-Inertia-Partial-Component` header includes the name of the component that is being partially reloaded. This is necessary, since partial reloads only work for requests made to the same page component. If the final destination is different for some reason (eg. the user was logged out and is now on the login page), then no partial reloading will occur.
0 commit comments