Repository navigation
When using vite. Is the AddLinkHeadersForPreloadedAssets middleware redundant ? #58225
|
Laravel Version PHP Version Description That's mean the |
Replies: 1 comment
|
Good question! They serve slightly different purposes: AddLinkHeadersForPreloadedAssets middleware:
Vite's built-in preload:
Are they redundant? Not exactly - HTTP Link headers can give a small performance boost because the browser can start fetching before it even sees the HTML. But honestly, for most apps the difference is negligible. My recommendation:
The middleware is there as an option, not a requirement. If you're not seeing performance issues, you probably don't need it. |
Good question! They serve slightly different purposes:
AddLinkHeadersForPreloadedAssets middleware:
Linkheaders withrel=preloadVite's built-in preload:
<link rel="modulepreload">tags in HTML<head>Are they redundant?
Not exactly - HTTP Link headers can give a small performance boost because the browser can start fetching before it even sees the HTML. But honestly, for most apps the difference is negligible.
My recommendation: