How to speed up your site and get seen better on Google

A slow site both drives visitors away and falls behind in Google results. Google measures user experience with metrics called Core Web Vitals and takes it into account in ranking. The good news is that most slowness comes from a few repeated mistakes and is fixed with specific steps. In this post we review those steps in order of their impact.
The three numbers Google looks at
Before any change you need to know what you're measuring. Core Web Vitals has three metrics:
- LCP: the time at which the largest visible part of the page, usually the main image or headline, is fully displayed. Good means 2.5 seconds or less.
- INP: the gap between a user's click or tap and the page's response. Good means 200 milliseconds or less.
- CLS: the amount of sudden shifting of page elements during loading. Good means 0.1 or less.
Each has a specific cause. LCP depends mostly on the image and server, INP on JavaScript, and CLS on elements that have no predefined size.
1. Make images lighter
On most sites the heaviest part of the page is the images. Three simple steps have the biggest effect:
- The right format: WebP and AVIF usually have much smaller file sizes than JPG and PNG at the same quality the eye sees.
- The right size: An image that is 400 pixels wide on mobile shouldn't download a 2000-pixel version. With
srcsetandsizescreate several sizes so the browser picks the most suitable one itself. - Lazy loading, but not for everything:
loading="lazy"It's great for images lower on the page, but the main image at the top shouldn't be lazy. Conversely, withfetchpriority="high"tell the browser to fetch it sooner.
One more tip: for each image, set width and height . With these two numbers, the browser reserves the image's place before it arrives and the text below doesn't jump down. This simple step keeps CLS low.
2. Keep fonts on your own site
A font that comes from an external service needs a separate connection to another server, and in Iran it's sometimes slow or cut off. Put the font file on the site's own server, load only the weights you actually use, and choose the WOFF2 format. With font-display: swap the text is also shown in a system font before the font arrives, and the page doesn't stay blank.
3. Tell the browser what to keep
Files that don't change, such as images, fonts, and CSS and JavaScript files whose names change with each version, don't need to be downloaded again on every visit. Set a long-term cache header for these files:
Cache-Control: public, max-age=31536000, immutable
This has no effect on the first visit, but makes the second page and later visits almost instant. For HTML pages themselves, a short cache is more suitable so fresh content doesn't reach the user late.
4. Drop extra JavaScript
Every kilobyte of JavaScript has to be downloaded, parsed, and run, and during that time the page responds slowly to the user's click. This is what ruins INP. A few common places to save:
- Remove plugins and scripts that are no longer used.
- Load heavy tools like maps, live chat, or video only when the user reaches that section.
- Don't hide the top of the page behind an entrance animation. A headline or image that appears with a fade is, from LCP's point of view, displayed later.
5. Take the server seriously
No optimization makes up for a slow server. The time it takes for the first byte of the response to arrive (TTFB) is the foundation of all other numbers. Turn on Gzip or Brotli compression, use HTTP/2 or HTTP/3, and if most of your audience is in Iran, choose a server close to them. Server-side caching for pages that are the same for everyone also reduces database load.
Measure correctly
PageSpeed Insights shows two kinds of numbers. The top section is real user data from the past 28 days, if the site has enough traffic, and the bottom section is a simulated test on an average phone. The lab score moves up and down a few points from one run to the next, so don't decide from one run. Test several times and look at the trend.
After each change, don't look only at the score. The “Opportunities” and “Diagnostics” sections tell you exactly which file or element has a problem, and that is the best place to start.
Summary
The suggested order of work is this: images first, then fonts and caching, then JavaScript, and the server last. On most sites the first two steps alone solve a large part of the problem. Speed is only one of the foundations of SEO; for the rest, see the On-page SEO checklist for every page too. If you want us to review your own site's speed together, from the contact page page.


