Skip to content

Testing & Benchmarking

Measuring Accelerate Guru's impact requires methodology. A single Lighthouse run is not enough — Lighthouse has variance, your network matters, and browser caching can mask or exaggerate results. This page covers the correct way to measure before-and-after performance.


#The built-in check command

The fastest way to verify Accelerate Guru is working correctly is:

accelerate-guru check --url https://yourstore.com

This command:

  1. Fetches your homepage directly from the Magento origin (bypassing the proxy).
  2. Fetches your homepage through the proxy.
  3. Compares both responses and reports:
    • Cache hit/miss status
    • Compression encoding used
    • AVIF images served
    • Response time difference
    • Any new JavaScript errors introduced by the proxy
    • CORS issues
    • HTML size before and after optimisation
    • Missing or incorrect headers

Example output (healthy install):

ACCELERATE GURU HEALTH CHECK
=============================

CONNECTION
  Origin:  http://127.0.0.1:8080 → 200 OK (824ms)
  Proxy:   https://yourstore.com  → 200 OK (3ms) ← CACHE HIT

COMPRESSION
  Encoding: zstd ✓
  HTML size: 89 KB → 21 KB (−76%)

IMAGES
  Hero image: AVIF served ✓  (original: 1.1 MB → 44 KB, −96%)
  LCP preload: <link rel=preload> injected ✓

SECURITY
  WAF: active ✓
  X-Content-Type-Options: nosniff ✓
  X-Frame-Options: SAMEORIGIN ✓

JAVASCRIPT
  Console errors from proxy: none ✓
  Scripts deferred: 8 scripts ✓

RESULT: All checks passed. Cache hit rate: 100% (warm cache)

#Google PageSpeed Insights

Google PageSpeed Insights runs Lighthouse in Google's lab environment and is the standard reference for Magento performance.

#How to use it correctly

  1. Warm the cache first. Visit your homepage through the proxy 2–3 times before running PageSpeed. A cold cache will show slower results.

  2. Test the correct URL. If your proxy is on https://yourstore.com but Magento's base URL is http://127.0.0.1:8080, make sure you're testing the proxy URL.

  3. Use Mobile view. The Mobile score is the primary Lighthouse score for Google ranking purposes. Desktop is easier to pass but less representative.

  4. Run 3 times and average. Lighthouse has variance of ±5–10 points. Run three times and use the median.

#What to expect

MetricBeforeAfter (target)
Performance score (mobile)15–3090–100
TTFB800–2000 ms< 500 ms
First Contentful Paint3–6 s< 1.5 s
Largest Contentful Paint5–12 s< 2.5 s
Total Blocking Time500–2000 ms< 200 ms
Cumulative Layout Shift0.1–0.4< 0.1

#Reading the report

The Lighthouse report's Opportunities section shows exactly what is contributing to your score. After a successful Accelerate Guru install, most of these should be gone or significantly reduced:

  • "Reduce initial server response time" — resolved by caching (TTFB drops from 800ms to 3ms).
  • "Serve images in next-gen formats" — resolved by AVIF encoding.
  • "Efficiently encode images" — resolved by AVIF encoding.
  • "Eliminate render-blocking resources" — resolved by script deferral and Critical CSS.
  • "Enable text compression" — resolved by zstd/brotli compression.
  • "Serve static assets with an efficient cache policy" — resolved by Cache-Control: max-age=31536000 headers on assets.

#Lighthouse CLI

For automated testing in CI/CD pipelines:

# Install
npm install -g lighthouse

# Run (mobile, performance category only)
lighthouse https://yourstore.com \
  --preset=perf \
  --emulated-form-factor=mobile \
  --throttling-method=simulate \
  --output=json \
  --output-path=./lighthouse-report.json

# Extract the score
cat lighthouse-report.json | jq '.categories.performance.score * 100'

#Correct throttling settings for before/after comparison

Use identical settings for both measurements:

lighthouse https://yourstore.com \
  --preset=desktop \
  --throttling.rttMs=40 \
  --throttling.throughputKbps=10240 \
  --throttling.cpuSlowdownMultiplier=1 \
  --output=html \
  --output-path=./report.html

#WebPageTest

WebPageTest provides more detailed waterfall views and is excellent for identifying bottlenecks. Key settings:

  • Location: choose a test location geographically near your target market.
  • Browser: Chrome (latest).
  • Connection: 4G (for mobile), Cable (for desktop).
  • Repeat view: always check the Repeat View tab — this shows performance for a returning visitor with a warm browser cache.

After Accelerate Guru installation, the Repeat View should show most static assets served from the Service Worker or browser cache (shown as green in the waterfall).


#Verifying cache and compression headers with curl

# Check cache and compression headers
curl -sI -H "Accept-Encoding: zstd, br, gzip" https://yourstore.com/ | \
  grep -E "x-cache|content-encoding|age|cache-control"

Expected response headers on a cache hit:

x-cache: HIT
content-encoding: zstd
age: 3600
cache-control: public, max-age=5, stale-while-revalidate=60

#What each header means

HeaderValueMeaning
x-cacheHITResponse served from DragonflyDB
x-cacheMISSResponse fetched from Magento origin
content-encodingzstdBody compressed with zstd
content-encodingbrBody compressed with brotli
age3600Entry has been in cache for 1 hour
x-ag-varyhashMagento variation segment for this cache entry

#Verifying AVIF images

# Check that an image is served as AVIF
curl -sI \
  -H "Accept: image/avif,image/webp,image/*,*/*;q=0.8" \
  "https://yourstore.com/media/catalog/product/shoe.jpg" | \
  grep content-type

Expected: content-type: image/avif

If you see content-type: image/jpeg, the image hasn't been encoded yet (background encoding is in progress). Wait 30 seconds and try again.


#Common reasons for a lower-than-expected score

#Score is still below 90 after install

  1. Cache not warm. Run accelerate-guru check --url https://yourstore.com — if it shows MISS, the cache isn't populated yet. Visit the homepage 5–10 times or set warmup_sitemap.

  2. Large third-party scripts. Google Tag Manager, live chat widgets, and payment SDK pre-loads can consume 200–500 ms of TBT regardless of how fast your pages load. Enable delay_third_party_js = true in [optimization_assets].

  3. force_defer_js = false. Ensure JavaScript deferral is enabled:

    [optimization_assets]
    force_defer_js = true
    
  4. LCP image not being preloaded. Check that preload_lcp_image = true and that the <link rel=preload> appears near the top of <head>.

  5. High CLS from images without dimensions. Ensure inject_asset_dimensions = true.

  6. Font still loading from Google CDN. Enable font self-hosting:

    [optimization_fonts]
    enabled = true
    

#TTFB is still high

  • Check that the cache is warm (x-cache: HIT in response headers).
  • If x-cache: MISS, every request goes to Magento. Check DragonflyDB is running: redis-cli ping.
  • If DragonflyDB is running but no hits occur, check redis_host / redis_port in [cache].

#PageSpeed score is 95 locally but 70 on Google's servers

Google's lab tests simulate a 4G mobile connection with CPU throttling. A score of 70 from Google versus 95 from your local test usually means there is a large JavaScript bundle that blocks the main thread. Enable delay_third_party_js and check the Lighthouse TBT metric specifically.