Personal Growth
Audit Laravel Microservices Performance and Identify Slow User Interactions
by Rakesh kumar · updated 10/13/2026
Prompt
GLOBAL INSTRUCTIONS Act as a senior Laravel, Livewire, and microservices performance engineer. First, read my performance optimization blog and use its parameters as the audit framework: https://www.debug.school/rakeshdevcotocus_468/laravel-microservices-performance-optimization-a-priority-wise-plan-to-speed-up-holidaylandmark-2o9l Enter Plan Mode first. Do not change code, configuration, caches, or server processes until I review and explicitly approve your proposed approach. Read the project’s AGENTS.md and CLAUDE.md. Verify the installed Laravel and Livewire versions, repository structure, authentication flow, and deployment architecture. Map all repositories, then inspect those involved in the specific navigation flows below. Trace each action through: UI → route → middleware/authentication → controller or Livewire component → composers → service/API calls → database queries → rendering → browser assets. Evaluate these performance parameters where relevant: 1. Server overhead: OPcache, configuration/route caching, logging, and PHP-FPM. 2. Authentication: repeated profile-user lookups, token handling, and retry rules. 3. HTTP N+1: per-row calls, duplicate lookups, unused requests, and sequential fan-outs. 4. Reference-data caching and invalidation. 5. Synchronous email, notification, and FCM work. 6. Livewire requests, large public properties, full-list reloads, and composer scope. 7. Image sizes, loading behavior, payloads, and asset caching. 8. Internal transport, connection overhead, timeouts, retries, and concurrency. 9. Database queries, indexes, joins, counts, filters, and pagination. Use available runtime evidence: browser HAR, Apache %D, PHP-FPM slow logs, application traces, upstream-call timings, and database query plans. Do not invent timings or claim a confirmed root cause from code inspection alone. Separate confirmed findings from suspected bottlenecks. If evidence is unavailable, explain how to collect it without changing the environment. Preserve existing functionality, authentication, permissions, filtering, sorting, pagination, and displayed data. SPECIFIC TASK — SLOW NAVBAR NAVIGATION Audit why clicking these two navbar links takes time: 1. Discover Trips 2. Discover Organizers Identify the exact navbar links, destination routes, components/controllers, and downstream services. Explain the delay between clicking each link and the destination page becoming usable. For Discover Trips, inspect: - Trip-list retrieval, pagination, filtering, and sorting. - Per-trip organizer, location, image, pricing, availability, or other related lookups, where present. - Repeated reference-data calls, expensive queries, and oversized responses. For Discover Organizers, inspect: - Organizer-list retrieval, pagination, filtering, and sorting. - Per-organizer profile, verification, rating, trip-count, or expanded-metrics lookups, where present. - Repeated user/profile calls, expensive aggregate queries, and oversized responses. For both pages: - Check authentication middleware and NavbarComposer for repeated calls. - Identify the navigation mechanism, such as full-page navigation or Livewire navigation. - Distinguish initial navigation from subsequent Livewire requests. - Compare cold and warm loads, and guest and authenticated access where supported. - Separate server response delay from browser rendering and image-loading delay. - Identify calls that are necessary, duplicated, unused, sequential, or safe to batch/cache. - Explain whether the navbar itself causes the delay or the destination page’s loading process causes it. REQUIRED OUTPUT 1. A separate, plain-language diagnosis for each page. 2. A complete request-flow explanation for each navigation action. 3. An evidence table containing: Page/action | Repository | File:line | Finding | Request/query count | Measured duration, if available | Confidence. 4. A priority-wise solution plan following the blog and screenshot order: P1 Server tuning P2 Authentication caching P3 HTTP N+1 removal P4 Queue and worker P5 Livewire hygiene P6 Reference-data caching P7 Image pipeline P8 Concurrency and transport P9 Database growth hygiene Mark irrelevant areas as “Not applicable” with a reason. Adjust priorities only when evidence justifies it. 5. For every proposed fix, explain: What is slow, why it is slow, where it occurs, who should handle it, when to apply it, and how the solution helps. 6. Simple before/after behavior, expected impact, dependencies, and regression risks. 7. Shared fixes that improve both pages. 8. Baseline measurement, functional validation, and rollback plans. Finish with a concrete, reviewable proposal. Wait for my explicit approval before implementing any changes. Solution:== Discover Trips (/trips/ → TripsController@index), P3 + P6: each trip card makes its own call to hl-booking for availability (up to 12 per page, cached only 60 s), and three more calls (listings, wishlist ids, calendar ids) plus the empty hero banner are fetched on every load without caching. Fetching availability in one batch call (or only when the booking modal opens) and caching those lookups would remove most of the wait. Discover Organizers (/trips/organizers → OrganizersController@index), P3 + P6: the page makes one uncached Keycloak call per active organizer to get their avatar, even for organizers it then hides because they have no trips. Caching avatars and filtering out zero-trip organizers before the avatar loop would remove those N calls.