HttpGateway
class HttpGateway implements DisablesSsr, ExcludesSsrPaths, Gateway, HasHealthCheck
Traits
Methods
Get the paths excluded from SSR for the current request.
Call the given value if callable and inject its dependencies.
Determine if the given value is callable, but not a string.
Get the Guzzle client for SSR requests.
Set a Guzzle client for testing purposes.
Exclude the given paths from server-side rendering.
Handle an SSR rendering failure.
Determine if the SSR server is healthy.
Determine if the bundle existence should be ensured.
Check if an SSR bundle exists.
Get the production SSR server URL.
Get the Vite hot SSR URL.
Flush all static state.
Details
in
ExcludesPaths at line 14
protected bool
inExceptArray(Request $request)
Determine if the request has a URI that should be excluded.
at line 173
array
getExcludedPaths()
Get the paths excluded from SSR for the current request.
Overrides ExcludesPaths::getExcludedPaths() to read from per-request InertiaState instead of an instance property.
in
ResolvesCallables at line 14
protected mixed
resolveCallable(mixed $value)
Call the given value if callable and inject its dependencies.
in
ResolvesCallables at line 22
protected bool
useAsCallable(mixed $value)
Determine if the given value is callable, but not a string.
at line 62
protected ClientInterface
ssrClient()
Get the Guzzle client for SSR requests.
Uses a dedicated raw Guzzle client instead of the Http facade to avoid per-request PendingRequest, HandlerStack, and Client allocations. The client is cached for the worker lifetime, allowing Guzzle's internal CurlFactory to reuse curl handles (TCP connection reuse).
at line 82
static void
useTestingClient(ClientInterface|null $client)
Set a Guzzle client for testing purposes.
Tests only. The client persists in a static property for the worker lifetime and is used by every SSR dispatch on this worker.
at line 92
Response|null
dispatch(array $page, Request|null $request = null)
Dispatch the Inertia page to the SSR engine via HTTP.
at line 149
void
disable(Closure|bool $condition)
Set the condition that determines if SSR should be disabled.
at line 159
void
except(array|string $paths)
Exclude the given paths from server-side rendering.
at line 188
protected void
handleSsrFailure(array $page, array|null $error)
Handle an SSR rendering failure.
Sets the circuit breaker backoff and dispatches a failure event.
at line 215
protected bool
ssrIsEnabled(Request $request)
Determine if the SSR feature is enabled.
at line 234
bool
isHealthy()
Determine if the SSR server is healthy.
at line 248
protected bool
shouldEnsureBundleExists()
Determine if the bundle existence should be ensured.
at line 256
protected bool
bundleExists()
Check if an SSR bundle exists.
at line 264
string
getProductionUrl(string $path = '/')
Get the production SSR server URL.
at line 275
protected string
getHotUrl(string $path = '/')
Get the Vite hot SSR URL.
at line 283
static void
flushState()
Flush all static state.