Skip to content

Commit cc28b6f

Browse files
Merge pull request #5 from skryukov/update-the-protocol
Add Request Lifecycle Diagram
2 parents f18601f + 1ee7b52 commit cc28b6f

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

images/checks-passed.png

-157 KB
Binary file not shown.

images/hero-dark.png

-108 KB
Binary file not shown.

images/hero-light.png

-102 KB
Binary file not shown.

v2/core-concepts/the-protocol.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ When the server detects the `X-Inertia` header, instead of responding with a ful
4949
}
5050
```
5151

52+
## Request Lifecycle Diagram
53+
54+
The diagram below illustrates the request lifecycle within an Inertia application. The initial visit generates a standard request to the server, which returns an HTML application skeleton containing a root element with hydrated data. For subsequent user interactions and navigation, Inertia sends XHR requests that return JSON data. Inertia uses this response to dynamically hydrate and swap the page component without a full page reload.
55+
56+
```mermaid
57+
sequenceDiagram
58+
participant Client
59+
participant Server
60+
61+
Client->>Server: First Visit
62+
Server-->>Client: Returns HTML Skeleton
63+
64+
Note over Client: Inertia.js is loaded
65+
66+
Client->>Server: Inertia Request (X-Inertia: true)
67+
Server-->>Client: Returns JSON Payload (Component Name, Props, etc.)
68+
69+
Note over Client: Inertia.js swaps components
70+
```
71+
5272
## Request Headers
5373

5474
The following headers are automatically sent by Inertia when making requests. You don't need to set these manually, they're handled by the Inertia client-side adapter.

0 commit comments

Comments
 (0)