Performance: Route parameters
MEDIUM IMPACT
This affects the server response time and initial page load speed by how routes are matched and parameters are parsed.
Route::get('/user/{id}', function ($id) { // handle request with minimal parameters });
Route::get('/user/{id}/{name}/{age}/{location}/{extra}', function ($id, $name, $age, $location, $extra) {
// handle request
});| Pattern | Route Matching Complexity | Server Processing Time | Impact on LCP | Verdict |
|---|---|---|---|---|
| Many route parameters | High (multiple segments to match) | Higher (more parsing and validation) | Slower LCP due to delayed response | [X] Bad |
| Minimal route parameters | Low (simple pattern) | Lower (less parsing) | Faster LCP with quicker response | [OK] Good |