Skip to content

How to Speed Up Your Website: The Complete Guide to Faster Performance

A complete guide to speeding up any website: hosting and TTFB, caching and its layers, a CDN, image and font optimization, reducing JS/CSS, the database and Core Web Vitals — with impact tables, measurement tools and practical steps ordered by priority.

Performance and speedمريم العتيبي25 min read
Illustration of a browser window with motion trails beside a stopwatch, representing a faster website
On this page

This guide is a comprehensive reference that works for any platform — WordPress, a custom store, a Next.js application or a static HTML page — because the principles of performance are the same even if the implementation tools differ. We'll rank everything by actual impact so you know where to start and when to stop.

Why does site speed really matter?

Speed isn't a technical luxury but a direct business factor. Every fraction of a second of load time costs you visitors, conversions and search rankings. A visitor on a phone has no patience: if the page doesn't appear quickly, they hit the back button and go to a faster competitor, which is known as a "bounce."

The impact is concentrated in three areas:

  • Bounce rate: the longer the load time, the higher the chance the visitor leaves before even seeing the content. The deterioration accelerates after the first few seconds.
  • Conversion rate: stores and pages that collect data or sell see their conversions suffer with every delay, because friction breaks purchase intent.
  • Search rankings: Google uses page experience metrics (Core Web Vitals) among its ranking factors, and site speed affects crawl budget — the number of pages the engine indexes each day. It is no longer limited to search engines: visibility in AI answers also requires a page the crawler can reach and read without JavaScript.
AreaEffect of slownessTrend
BounceRises the longer loading takesEvery extra second increases the loss
Conversion/salesFalls with delayFriction breaks the intent to complete
Search rankingsA negative signalHurts Core Web Vitals and crawling
Visitor satisfactionDeclinesThe perception "the site is slow" sticks in memory
How does slowness raise the bounce rate?BounceLoad time (seconds)1s3s5s7sEvery extra second of delay raises the chance of leaving
The relationship between load time and bounce rate: the later the page loads, the higher the chance the visitor leaves before interacting.

The key point: perceived speed matters as much as actual speed. A visitor who sees the main content within moments while the rest finishes in the background feels the site is fast, even if the total load time for all elements is longer.

What are Core Web Vitals and what are their targets?

Core Web Vitals are a set of metrics Google created to measure real user experience, not just lab performance. Three core metrics govern how a page is judged:

  • LCP (Largest Contentful Paint): the time until the largest visible element in the viewport is rendered (usually the main image or a large heading). It measures how quickly the most important content appears.
  • INP (Interaction to Next Paint): the time from a user interaction (a click, typing) until they see a visible response. It replaced FID and now measures page responsiveness across the entire session.
  • CLS (Cumulative Layout Shift): how much elements "jump" and shift during loading. It measures visual stability.
MetricGoodNeeds improvementPoorWhat it measures
LCP≤ 2.5s2.5s – 4s> 4sHow fast the largest element appears
INP≤ 200ms200ms – 500ms> 500msHow fast the page responds to interaction
CLS≤ 0.10.1 – 0.25> 0.25Visual layout stability

What matters is that these targets are measured on field data (real users via the Chrome User Experience Report), not just lab data. Lighthouse may give you an excellent score in an ideal environment while your users struggle on slower networks and devices. So always follow the field data section in PageSpeed Insights, which is what Google actually relies on.

How do you measure your site's speed? Metrics and tools

You can't improve what you don't measure. Measuring before any change gives you a baseline, and measuring after proves the improvement actually worked. The most important metrics to track:

  • TTFB (Time To First Byte): the time from sending the request until the first byte arrives from the server. It reflects the health of the hosting and backend caching. A good target: usually under 200–500 milliseconds.
  • FCP (First Contentful Paint): when the first visible content (text or an image) appears on the screen.
  • LCP: as above, the largest visible element.
  • TTI (Time To Interactive): when the page becomes reliably interactive without delay.

Core measurement tools

ToolField data?Best forNote
PageSpeed InsightsYes + labThe official Core Web Vitals verdictShows real CrUX data
GTmetrixLabA detailed waterfall reportChoose a test location close to your audience
WebPageTestAdvanced labDeep analysis across multiple locations and browsersFilmstrip + before/after comparison
LighthouseLabA local audit inside DevToolsGives prioritized recommendations
Chrome DevToolsDirectDiagnosing INP/CLS while browsingThe Performance and Network panels

A practical rule for measuring

Always test in incognito mode without browser extensions, and repeat the test 3–5 times and take the median, not the best result, because a single result can be misleading due to cache state or network congestion. And test under mobile conditions (a slow network, a limited processor), because they are the harshest and what most of your visitors face.

Ranking by impact: where do you start?

The biggest mistake is starting with small improvements (compressing an image here, minifying a line of CSS there) before dealing with the foundation. Below is a rough ranking of impact versus effort to help you set priorities:

ImprovementExpected impactEffortPriority
Good hosting + low TTFBVery highMedium1
Page/object/opcode cachingVery highLow–medium2
Image optimization (format + dimensions + lazy)HighLow3
A CDNHigh (distributed audience)Low4
Reducing/deferring JavaScriptHighMedium–high5
Brotli/Gzip compression + HTTP/2/3MediumLow6
Font optimizationMediumLow7
Critical CSS and removing unused CSSMediumMedium8
Optimizing the database and queriesMedium–high (dynamic sites)Medium9

The rule: deal with the lower layers first (hosting and caching), because an improvement there lifts every page at once, while improving a single page stays limited to that page.

Hosting and TTFB: the foundation of everything

No front-end optimization can make up for a slow server. If TTFB is high, the visitor waits before any byte reaches them at all, and everything after it is delayed in turn. The hosting elements that determine TTFB:

  • NVMe drives: much faster than traditional SSDs, and many times faster than mechanical disks at reading files and database operations.
  • Sufficient resources (CPU/RAM): crowded shared hosting shares resources with hundreds of sites, so response times fluctuate under load. The more dedicated resources you have, the more stable TTFB becomes.
  • A modern web server: LiteSpeed or Nginx outperform traditional Apache at serving concurrent requests and at integrating caching. LiteSpeed in particular comes with an effective built-in cache.
  • The server's geographic location: the closer the server is to your audience, the shorter the round trip. If your audience is in the Gulf, a server in or near the region reduces response time compared with a server on another continent.
  • HTTP/2 and HTTP/3: they allow multiple requests over a single connection and reduce connection setup time. HTTP/3 over QUIC improves performance on unstable networks such as mobile. Enabling them is usually tied to HTTPS, so see the guide to installing SSL and enabling HTTPS.
Hosting typeExpected TTFBSuitabilityWhen to choose it
Crowded sharedHigh and fluctuatingVery small sitesStarting on a tight budget
Good shared (NVMe + LiteSpeed)Medium–lowBlogs and brochure sitesMost new sites
VPSLow and stableStores and medium–high trafficWhen you need guaranteed resources
ManagedLowSites that need performance without technical managementA non-technical team

To understand the differences in depth, see the comparison of shared, VPS and managed hosting. If TTFB stays high despite caching, the problem is usually the hosting plan itself or how crowded it is.

Caching and its layers: why is it the cheapest speedup?

Caching means storing a ready result instead of rebuilding it on every request. Instead of the server running the code, querying the database and building the page from scratch for every visitor, it serves a saved copy immediately. This reduces TTFB and resource usage considerably, and it is one of the highest-impact, lowest-effort optimizations.

The main caching layers:

LayerWhereWhat it storesImpact
Browser cacheThe visitor's deviceStatic assets (images, CSS, JS)Eliminates reloading on repeat visits
Page cacheThe serverComplete pre-built HTMLLowers TTFB considerably
Object cacheThe server (Redis/Memcached)Database query resultsSpeeds up dynamic pages
Opcode cachePHP on the serverCompiled PHP codeEliminates recompiling the code
CDN/edge cacheDistributed serversAssets and sometimes HTMLBrings content closer to the visitor

Each layer addresses a different bottleneck, and it is best to enable them together. Setting the right cache headers on static assets is simple and effective:

Code
Cache-Control: public, max-age=31536000, immutable

This header tells the browser to keep the file for a full year without requesting it again, and it is used safely with filenames that carry a content fingerprint (versioned filenames). For full details on each layer, when to use it and how to invalidate the cache safely, see the detailed caching guide.

A CDN: when do you need one?

A CDN (content delivery network) is a set of geographically distributed servers that store copies of your site and serve each visitor from the point closest to them. Instead of a visitor's request from a distant continent traveling the full distance to the origin server, the content reaches them from a nearby server.

You need a CDN especially when:

  • Your audience is spread across multiple countries or continents.
  • Your site contains heavy assets (images, video, download files).
  • You want extra protection, mitigation of load attacks and blocking of harmful crawling.
SituationBenefit of a CDN
A local audience near the serverLimited (the server is already close)
A distributed international audienceVery high
Heavy assets (media)High (offloading the origin)
Protection + attack mitigationHigh regardless of location

Many CDNs offer extra features: automatic compression, converting images to modern formats, minifying assets, and HTTP/3 at the edge. For a detailed explanation of how it works, setup and benefits, see the CDN guide. An important note: a CDN complements good hosting and doesn't make up for a slow origin server — because first and uncached requests go back to the origin.

How do you optimize images? The heaviest element on the page

Images are usually the biggest contributor to page weight, and they are usually the LCP element. Optimizing them delivers one of the highest returns. The main areas:

  • A modern format: AVIF, then WebP, reduce size considerably compared with JPEG/PNG at similar visual quality.
  • Correct dimensions: don't serve a 4,000-pixel-wide image in an 800-pixel-wide container. Resize to the size actually displayed.
  • Compression: lowering quality slightly (for example, 80–85%) reduces size a lot with no noticeable visible difference.
  • Lazy loading: defer loading images outside the viewport until the visitor scrolls close to them.
  • srcset and responsive sizes: provide copies in different sizes so the browser picks the most suitable one for each screen.
  • The LCP image exception: don't lazy-load the main (LCP) image; load it immediately and use preload for it to speed up its appearance.
FormatRelative sizeSupportBest for
JPEGLargeUniversalPhotographs (legacy)
PNGVery large (transparency)UniversalGraphics with transparency (legacy)
WebPClearly smallerVery wideAn excellent general alternative
AVIFUsually the smallestWide and growingThe best compression, with a fallback
JPEG vs. WebP vs. AVIF (file size)JPEGWebPAVIF≈ 100%≈ 70%≈ 50%Approximate ratios for the same image — lighter loads faster
The same image in three formats: WebP is clearly lighter than JPEG, and AVIF is the lightest — a big gain in page weight without noticeable visual loss.

An example of preloading the LCP image:

html
<link rel="preload" as="image" href="/hero.avif" fetchpriority="high" />

An expert tip: always specify width and height (or the aspect ratio) for every image. This reserves its space in advance and prevents layout shift (CLS) when it loads. On WordPress in particular, image optimization plugins automate most of this — see the guide to speeding up WordPress.

How do you optimize fonts?

Custom fonts are beautiful, but they can delay text from appearing or cause visual jumps. The main optimizations:

  • Subsetting: remove unused characters. A complete Arabic font is heavy, so load only the range you need.
  • Preload the critical font: preload the main body font so it is ready at render time.
  • font-display: swap: show the text in a fallback font immediately and then swap in the custom font when it is ready, instead of leaving the text invisible.
  • Reduce the number of weights: each weight (regular, bold, etc.) is an extra file. Stick to the weights you actually use.
  • Host fonts locally: serving them from your own domain avoids an extra connection to an external domain.
css
@font-face {
  font-family: "MyFont";
  src: url("/fonts/myfont-subset.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}
ImprovementImpactNote
SubsetStrongly reduces file sizeVery important for Arabic fonts
Preloading the critical fontSpeeds up text appearanceFor the main font only
font-display: swapPrevents invisible textImproves perceived speed
Fewer weightsFewer requests and smaller sizeRemove what you don't use
Local hostingEliminates an external connectionWith woff2

Use the woff2 format, since it is the most efficient and compact and is widely supported.

Reducing JavaScript and CSS

JavaScript is the heaviest resource on the processor, and it is the most common cause of poor INP and delayed interaction. The page may appear quickly but not respond because the browser is busy executing scripts. The main areas:

  • Minification: remove whitespace and comments from JS and CSS to reduce size.
  • defer and async: defer the execution of non-critical scripts so they don't block page rendering. Use defer for scripts that need ordering, and async for independent ones.
  • Remove what is unused: delete libraries and plugins you don't use. Every extra script is a cost.
  • Code splitting: load each page's code when needed instead of one giant bundle for the whole site.
  • Critical CSS: extract the CSS needed for the visible part first and inline it, and defer the rest of the CSS.
html
<!-- A non-critical script is deferred so it doesn't block rendering -->
<script src="/analytics.js" defer></script>
MethodBlocks rendering?When it runsUse
A regular <script>YesImmediately when encounteredAvoid it for heavy scripts
asyncNoWhen it is ready (order not guaranteed)An independent script such as analytics
deferNoAfter HTML parsing, in orderScripts that depend on the DOM

An expert tip: keep an eye on "third parties" (ads, tracking, chat widgets). These external scripts are often the biggest source of slowness, and you don't control their performance. Lazy-load them, and load the chat widget only when the user interacts, not at the start of loading.

When your site outgrows shared hosting because of high traffic or heavy processing, upgrading to dedicated resources solves what front-end optimization alone can't. Learn about VPS hosting and when it becomes a necessity.

Reducing the number and size of requests

Every file on your page is a separate request with its own cost. Reducing the number of requests and their size improves speed, especially on slow networks.

  • Transfer compression (Brotli/Gzip): enable compression of text responses. Brotli is usually more efficient than Gzip, and both reduce the size of HTML/CSS/JS over the network considerably.
  • Combining when needed: with HTTP/1.1, combining files was useful for reducing requests. With HTTP/2 and HTTP/3 this is less pressing, because requests are multiplexed over a single connection, so don't overdo combining.
  • Remove unnecessary resources: every icon, font or script that isn't used gets deleted.
ImprovementTarget resourceImpact
Brotli/GzipText HTML/CSS/JSStrongly reduces transferred size
HTTP/2/3All requestsMultiplexing over one connection
Removing unused resourcesEverythingFewer requests and smaller size

Check that compression is enabled via the response header:

Code
Content-Encoding: br

If you don't find br or gzip, compression isn't enabled — and it is one of the easiest and fastest wins.

The database and queries

Dynamic sites (WordPress, stores, applications) build their pages from a database. A slow query or a bloated table raises TTFB even with good hosting. The main areas:

  • Object caching: store the results of repeated queries in Redis or Memcached to avoid hitting the database on every request.
  • Indexes: add indexes on frequently queried columns to speed up lookups.
  • Cleaning up bloated data: delete old revisions, transient data and neglected logs that weigh down the tables.
  • Identify heavy queries: use slow-query profiling tools to find out where time is being lost.
ProblemSymptomFix
Expensive repeated queriesHigh TTFB for dynamic pagesObject caching (Redis)
Tables without indexesSlow queries that get slower with growthAdding suitable indexes
Bloated dataAn oversized databaseRegular cleanup
N+1 queriesA huge number of queries per pageBatching queries

A tip: on dynamic sites, full-page caching bypasses the database entirely for logged-out visitors, and it is the highest-impact optimization here. Keep database optimization for cases where full caching isn't possible (dashboards, pages customized for each user).

Mobile first

Most visits today come from phones, and their conditions are harsher: a weaker processor, a slower and less stable network, and less memory. Optimizing "mobile first" means testing and optimizing under these conditions, not on a powerful desktop computer with a fast connection.

The pillars of mobile performance:

  • Test by emulating a mid-range device on a slow network (DevTools settings).
  • Reduce JavaScript as much as possible, since the mobile processor is the biggest bottleneck for INP.
  • Serve images in sizes suited to the phone screen via srcset.
  • Be wary of ads and external scripts, since their impact on mobile is multiplied.

The rule: if your site is fast on a mid-range phone on a slow network, it is fast for everyone. The reverse isn't true.

A realistic scenario: a before/after table

To illustrate how improvements add up, here is a typical scenario for a medium content site on crowded shared hosting, with approximate figures representing general trends rather than proven measurements:

ItemBeforeAfterAction
TTFBHigh and fluctuatingLow and stableHosting upgrade + page caching
LCPOver 4sUnder 2.5sOptimizing the main image + preload
Page weightHeavy (large JPEG images)Clearly lighterConverting to AVIF/WebP + correct dimensions
JS requestsMany and blockingFewer and deferredRemoving unused code + defer
CLSHigh (jumping elements)Under 0.1Reserving dimensions for images and ads
INPSlowWithin the good rangeReducing third-party JS

The key observation: the improvement didn't come from a single magic action, but from addressing the layers in order — hosting and caching first (broad impact), then the front-end assets. This is the right approach.

Common mistakes

Avoid these recurring mistakes that derail speed efforts or waste time:

  • Starting with small improvements before the foundation: tuning a single image while the hosting is slow and caching is off. Deal with the lower layers first.
  • Relying on the Lighthouse lab score alone: a 100 in the lab doesn't mean a good experience in the field. Track real-user data.
  • Stacking conflicting optimization plugins: several caching/optimization plugins together can clash and slow things down instead of speeding them up. One trusted, well-configured plugin is better.
  • Lazy-loading the LCP image: this delays the most important visible element and hurts LCP directly.
  • Ignoring third-party scripts: tracking, ads and external widgets are often the biggest cause of slowness, and people forget to check them.
  • Not specifying image and ad dimensions: this causes layout shift (high CLS) when they load.
  • Measuring only after the cache is warm: testing with a hot cache hides the slowness of the first, cold visit. Test both cases.
  • Forgetting mobile: optimizing only on desktop while most visitors are on slower phones.

Diagnosing and fixing problems

When a particular metric fails, start from the symptom and work back to the cause. Below is a diagnostic guide organized by metric:

Slow LCP

Common causes: high TTFB, a heavy or unoptimized main image, a render-blocking resource (CSS/font), or no preloading.

CauseHow to checkFix
High TTFBMeasure TTFB in WebPageTestImprove the hosting + page caching
A heavy LCP imageCheck the size and format of the largest elementAVIF/WebP + correct dimensions + preload
A blocking resourceThe Network/Coverage tabDefer non-critical CSS/JS + critical CSS
A font that delays textThe Performance panelfont-display: swap + preload

High CLS

Common causes: images or ads without reserved dimensions, content injected dynamically above what is visible, fonts that cause reflow.

CauseFix
Images/iframes without dimensionsSet width/height or the aspect ratio
An ad whose space is reserved lateReserve the container's space in advance
A banner/notice injected at the top of the pageReserve its space or place it below the content
A font swap that shifts the textTune the fallback font to similar metrics

Poor INP

Common causes: long JavaScript execution blocking the main thread, heavy event handlers, taxing third-party scripts.

CauseFix
Long JS blocking the threadSplit long tasks and defer what isn't critical
Heavy third-party scriptsLazy-load them or load them on interaction
Unused codeRemoval + code splitting
Expensive event handlersSimplify them and defer heavy work

High TTFB despite caching

If TTFB stays high after enabling caching, the problem is usually the hosting itself: insufficient resources, a crowded server, or a distant geographic location. The solution here is upgrading or changing the plan, not more front-end optimization. Use WebPageTest from a location close to your audience to separate the effect of distance from the effect of the server.

Conclusion

Speeding up a site is an orderly method, not a collection of scattered tricks. Start from the foundation: hosting with a low response time, then apply caching in all its layers, because it is the cheapest and highest-impact speedup, then distribute content with a CDN if your audience is spread out. After that, deal with the heaviest things on the page — images first, then fonts, JavaScript and CSS — and finish by optimizing the database for the dynamic parts. Measure before and after with objective tools, and ultimately judge by real-user data via Core Web Vitals, not by an isolated lab score. Devote more effort to mobile conditions, because they are the harshest and what most of your visitors live with. And remember the golden rule: one improvement in the right layer beats dozens of improvements in the wrong one.

The most important practical step right now: measure your site in PageSpeed Insights, identify the weakest metric, and fix it at its root following the impact order in this guide.

Frequently asked questions

How fast does a page actually need to be?

Aim to pass Core Web Vitals: LCP under 2.5 seconds, INP under 200 milliseconds and CLS under 0.1, measured on real-user data. These aren't arbitrary numbers but thresholds Google uses to assess page experience. Anything better than that is enough, and going far beyond what is required has diminishing returns.

What is the difference between lab data and field data?

Lab data is measured in a single controlled environment (such as Lighthouse), while field data comes from real users' visits on a variety of devices and networks through the Chrome User Experience Report. Google uses field data for its ranking assessment, so your lab score may be excellent while your users are actually struggling. Track both, but judge by the field data.

Is a CDN enough to speed up a slow site?

No. A CDN brings cached assets closer to the visitor, but it doesn't make up for a slow origin server, because first and uncached requests always go back to the origin. Start by fixing the hosting and caching, then add a CDN for wider geographic distribution. A CDN is a complement to a sound foundation, not a substitute for one.

Which image format should I use in 2026?

Use AVIF as the first choice for the best compression, with WebP as a fallback, and keep JPEG/PNG as a backup for older compatibility. Most image optimization tools and plugins generate these formats automatically and serve the most suitable one to each browser. Correct dimensions and compression matter too, not the format alone.

Do I need a VPS to make my site fast?

Not always. Many sites do fine on good shared hosting (NVMe + LiteSpeed + caching). But with high traffic, heavy processing or an active store, a VPS's dedicated resources make a real difference to TTFB stability. The rule: upgrade when you hit resource limits, not before.

Why is my site slow even though I installed a speed plugin?

Usually for one of two reasons: either the plugin isn't configured correctly (caching isn't actually enabled or conflicts with another plugin), or the problem is in a layer the plugin doesn't address, such as slow hosting and third-party scripts. A plugin is a tool, not a magic solution; pair it with a sound foundation and objective measurement.

How do third-party scripts affect speed?

Significantly, and it is often underestimated. Tracking tools, ads and chat widgets are external scripts whose performance you don't control, and they are often the biggest cause of poor INP and delayed interaction. Lazy-load them, defer what can be deferred, delete what you don't use, and load heavy widgets only when the user interacts.

Should I optimize for mobile or desktop first?

Mobile first. Its conditions are harsher (a weaker processor and network) and it is the source of most visits, so if your site is fast on a mid-range phone on a slow network, it is fast for everyone. Always test by emulating a mid-range device on a throttled network, not on your powerful computer with your fast connection.

How often should I measure my site's performance?

Measure after every significant change (a theme update, a new plugin, a hosting change) and regularly, at least monthly, because performance degrades silently as content and plugins accumulate. Keep monitoring the field data in Search Console, since it alerts you early, before your rankings are affected.

Sources

Frequently asked questions

How fast does a page actually need to be?

Aim to pass Core Web Vitals: LCP under 2.5 seconds, INP under 200 milliseconds and CLS under 0.1, measured on real-user data. These aren't arbitrary numbers but thresholds Google uses to assess page experience. Anything better than that is enough, and going far beyond what is required has diminishing returns.

What is the difference between lab data and field data?

Lab data is measured in a single controlled environment (such as Lighthouse), while field data comes from real users' visits on a variety of devices and networks through the Chrome User Experience Report. Google uses field data for its ranking assessment, so your lab score may be excellent while your users are actually struggling. Track both, but judge by the field data.

Is a CDN enough to speed up a slow site?

No. A CDN brings cached assets closer to the visitor, but it doesn't make up for a slow origin server, because first and uncached requests always go back to the origin. Start by fixing the hosting and caching, then add a CDN for wider geographic distribution. A CDN is a complement to a sound foundation, not a substitute for one.

Which image format should I use in 2026?

Use AVIF as the first choice for the best compression, with WebP as a fallback, and keep JPEG/PNG as a backup for older compatibility. Most image optimization tools and plugins generate these formats automatically and serve the most suitable one to each browser. Correct dimensions and compression matter too, not the format alone.

Do I need a VPS to make my site fast?

Not always. Many sites do fine on good shared hosting (NVMe + LiteSpeed + caching). But with high traffic, heavy processing or an active store, a VPS's dedicated resources make a real difference to TTFB stability. The rule: upgrade when you hit resource limits, not before.

Why is my site slow even though I installed a speed plugin?

Usually for one of two reasons: either the plugin isn't configured correctly (caching isn't actually enabled or conflicts with another plugin), or the problem is in a layer the plugin doesn't address, such as slow hosting and third-party scripts. A plugin is a tool, not a magic solution; pair it with a sound foundation and objective measurement.

How do third-party scripts affect speed?

Significantly, and it is often underestimated. Tracking tools, ads and chat widgets are external scripts whose performance you don't control, and they are often the biggest cause of poor INP and delayed interaction. Lazy-load them, defer what can be deferred, delete what you don't use, and load heavy widgets only when the user interacts.

Should I optimize for mobile or desktop first?

Mobile first. Its conditions are harsher (a weaker processor and network) and it is the source of most visits, so if your site is fast on a mid-range phone on a slow network, it is fast for everyone. Always test by emulating a mid-range device on a throttled network, not on your powerful computer with your fast connection.

How often should I measure my site's performance?

Measure after every significant change (a theme update, a new plugin, a hosting change) and regularly, at least monthly, because performance degrades silently as content and plugins accumulate. Keep monitoring the field data in Search Console, since it alerts you early, before your rankings are affected.