11 November 2026
تطبيقك بطيء؟ افحص سرعته مع Claude خطوة بخطوة: الصور والطلبات وقاعدة البيانات والكاشIs Your App Slow? Review Its Speed with Claude Step by Step: Images, Requests, Database and Cache
Built your app with AI and every tap waits? Follow the tap from the screen down to the database, find where the time goes, fix it with Claude, and measure the difference before and after.
Who this guide is for
Anyone who vibe coded a web or mobile app that feels heavy, even without a coding background
Key terms
- Query
- A question the server sends to the database, like: give me the products. Each one takes time, and many of them slow the screen down.
- The N + 1 problem
- The code loads a list with one query, then runs one more query for every item in it. Ten products become eleven queries instead of two.
- Cache
- A saved copy of an earlier response. While it is fresh, it comes back right away without the request reaching the server.
- Lazy loading
- Images below the screen load only when you get close to them. The first image you see when the page opens loads right away.
- INP
- A Google metric for how fast a page responds to your tap. 200 milliseconds or less is good, above 500 is poor.
The steps
Step 1
Measure before you change anything
Pick the three screens people use most, like home, the product list and a product page. Open each one and write down how long it takes to show fully and how long a tap takes to respond.
In the browser open DevTools and the Network tab and find the slowest requests. On the web, run Lighthouse and note INP. These are your before numbers. Without them you cannot tell if a fix worked.
Official Chrome docs: when to use the Network panel.Source: developer.chrome.com I want to measure my app's speed before changing anything. The project is built with [framework, e.g. Next.js, Flutter or React Native]. The key screens are [screen 1], [screen 2], [screen 3]. Write a simple measurement plan: what to measure on each screen, with which tool, and where to record it. Give me an empty table with: screen, load time, tap response time, number of requests, image weight. Do not change any code yet.PromptMeasurement promptTip: Measure on an average phone and network, not only on your fast machine.
Step 2
Have Claude review the whole project
Open the project in Claude Code and give it the ready prompt. It reads and reports first. Nothing gets fixed before you see the causes.
The report ranks the causes from biggest impact to smallest, each with the file, the line and a suggested fix.
You are a performance reviewer. Review this whole project and find the causes of slowness in four areas: 1. Images: size, format, whether they have width and height, and whether images below the screen use loading="lazy" while the first image does not. 2. API requests: duplicates, requests that run one after another but could run together, large responses with fields we do not use. 3. Database: queries inside loops (N + 1), queries without an index, selecting every column for no reason. 4. Cache: responses that repeat, rarely change, and have no cache. Do not edit any file. Write a report ranked from biggest impact to smallest: cause, file and line, rough expected saving, suggested fix.PromptFull review promptStep 3
Fix the database queries first
Start with the database, it is usually the biggest cause. The best known trap is N + 1: a list of ten products runs eleven queries, one for the list and one per product.
The fix is to load the related data together in two queries, like includes in Rails, select_related and prefetch_related in Django, or include in Prisma.
The report flagged [screen or file]. Find every place with a query inside a loop or a map (N + 1). For each one, show how many queries run now for a list of [count] items, then change the code to load the related data together with as few queries as possible, using the official approach in [ORM name]. Keep the result exactly the same and add a short comment explaining the change.PromptN + 1 promptTip: Turn on the query log and count queries before and after. The number tells you if the fix worked.
Step 4
Cache responses that rarely change
Categories, settings or a stable product list do not need a trip to the server every time. Keep the response in a cache for a set time.
On the web you can send Cache-Control with max-age, and the browser serves the stored copy right away while it is fresh. On the server you can store the query result in a cache like Redis.
web.dev: which response header values to use.Source: web.dev These requests repeat and their data rarely changes: [request 1], [request 2]. For each, suggest the right cache (browser cache with Cache-Control or a server cache), the right duration, and when to clear it when the data changes. Once I approve, add the cache and make sure no user specific data is stored in a shared cache.PromptCache promptTip: Never cache user specific data, the cart or checkout.
Step 5
Lighten the images
Images are usually the heaviest part of a page. Resize them to the size they are shown at, use a light format like WebP or AVIF, and give every image width and height so the page does not jump while loading.
Let images below the screen load late. Never delay the first image people see when the page opens.
web.dev: images visible on first load load right away, lazy is for the rest.Source: web.dev Review every image in [screen or folder]. For each: current size, the size it is actually shown at, and the format. Change the code so images are served at the right size for the screen, every image has width and height, images below the screen use loading="lazy", and the first image at the top loads right away without lazy. List the images I should export again at a smaller size.PromptImages promptStep 6
Combine requests that wait on each other
Sometimes a screen asks for one thing, waits, then asks for the next. If the two do not depend on each other, run them at the same time or merge them into one request.
Drop the fields you do not need from each response. Every kilobyte arrives faster.
Review the requests that run when [screen name] opens. Map their order: which request waits for which. Run the independent ones in parallel, merge many small requests into one where it makes sense, and trim every response to the fields the screen actually uses.PromptRequests promptStep 7
Measure again and compare
Go back to the same screens, on the same phone and network, and fill the table again. Compare every number before and after.
On the web, aim for a response to a tap within 200 milliseconds or less, per Google's INP metric. If a number did not improve, go back to the report and try the next cause.
web.dev: 200 milliseconds or less means good responsiveness.Source: web.dev Here are my before numbers: [paste table]. Here are my after numbers: [paste table]. Compare them screen by screen, tell me what improved and what did not, the most likely reason for what did not, and the next step.PromptComparison promptTip: Change one thing at a time and measure, so you know which change made the difference.
Ready prompts to copy
The takeaway
Do not add a new feature before you know where your users' time goes: measure, fix the biggest cause first, then measure again.
Liked this guide?
Join Mohammad's community
72 guides like this one, and a new one every week. One subscription opens them all.
Approximate price in your currency. You pay in AED
- A permanent archive. Open any guide, any time
- 20% off private build sessions
- Cancel any time, no commitment
Or without a subscription
Most value
Start building with me now
We sit together, break down your problem, and I build the AI solution with you step by step
- A private session with you
- Real building during the session
- Results you take with you when we finish
100% free
A free consultation about your problem



