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
While working on a JS adapter, I found a few pieces missing from the protocol docs that might help others.
Error bags will send the value through the X-Inertia-Error-Bag header, which the adapter uses to namespace the messages on the shared errors prop.
I have run into some caching issues in production as the Accept request header uses text/html. The Laravel adapter modifies the Vary header for every request to include X-Inertia. While not necessarily a requirement for the adapter to work, it is default behavior that can fix caching in most scenarios* in all adapters. The Inertia responses section should maybe display a different response:
HTTP/1.1 200 OK
Content-Type: application/json
Vary: X-Inertia, Accept
X-Inertia: true
*this unfortunately does not work with Cloudflare caching, as they do not use the Vary header in the cache key unless you are on an enterprise plan that can customize keys.
The text was updated successfully, but these errors were encountered:
While working on a JS adapter, I found a few pieces missing from the protocol docs that might help others.
Error bags will send the value through the
X-Inertia-Error-Bag
header, which the adapter uses to namespace the messages on the sharederrors
prop.I have run into some caching issues in production as the Accept request header uses
text/html
. The Laravel adapter modifies the Vary header for every request to includeX-Inertia
. While not necessarily a requirement for the adapter to work, it is default behavior that can fix caching in most scenarios* in all adapters. The Inertia responses section should maybe display a different response:*this unfortunately does not work with Cloudflare caching, as they do not use the Vary header in the cache key unless you are on an enterprise plan that can customize keys.
The text was updated successfully, but these errors were encountered: