Fix LCP Issues on Mivamerchant (Loading Speed) | OpsBlu Docs

Fix LCP Issues on Mivamerchant (Loading Speed)

Speed up Miva Merchant LCP by optimizing product images, enabling page caching, and deferring third-party extension scripts.

General Guide: See Global LCP Guide for universal concepts and fixes.

What is LCP?

Largest Contentful Paint measures when the largest content element becomes visible. Google recommends LCP under 2.5 seconds. Miva Merchant is a self-hosted e-commerce platform using its own template engine (MVTE/MVT). LCP depends on server-side rendering, image delivery, and extension script loading.

Miva-Specific LCP Causes

  • Unoptimized product images -- Miva stores original uploads and serves them at full resolution without automatic resizing
  • No built-in page cache -- every request processes through Miva's engine, generating HTML from scratch
  • Extension script bloat -- Miva extensions (payment, shipping, analytics) inject synchronous JavaScript
  • MVTE template complexity -- deeply nested template includes with multiple database lookups per page
  • Slow server hosting -- Miva is often self-hosted on underpowered servers

Fixes

1. Optimize Product Images

Miva serves original uploads. Process images before upload or use a CDN with transforms:

<!-- In your Miva page template (ReadyTheme or custom) -->
<img
  src="&mvt:product:image:url;"
  width="800" height="800"
  alt="&mvte:product:name;"
  loading="eager"
  fetchpriority="high"
  style="aspect-ratio: 1/1; width: 100%; height: auto; object-fit: contain;"
>

Pre-compress images before uploading to Miva's admin:

# Optimize product images to max 1200px width, 80% quality
find products/ -name "*.jpg" -exec mogrify -strip -quality 80 -resize "1200>" {} \;

2. Implement Server-Side Caching

Add full-page caching via your web server (Apache/Nginx):

# Nginx proxy cache for Miva pages
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=miva:10m max_size=1g;

location / {
    proxy_cache miva;
    proxy_cache_valid 200 1h;
    proxy_cache_bypass $cookie_session_id;
    proxy_no_cache $cookie_session_id;
    proxy_pass http://miva_backend;
}

3. Defer Extension Scripts

Move non-critical scripts to the bottom of the page with defer:

<!-- In your Miva page template footer -->
<script defer src="/mm5/extensions/analytics/tracker.js"></script>
<script defer src="/mm5/extensions/reviews/widget.js"></script>

4. Preload Hero/Product Images

<!-- In the <head> of your template -->
<mvt:if expr="g.Screen EQ 'PROD'">
  <link rel="preload" as="image" href="&mvt:product:image:url;" />
</mvt:if>
<mvt:if expr="g.Screen EQ 'SFNT'">
  <link rel="preload" as="image" href="/mm5/graphics/hero-banner.jpg" />
</mvt:if>

5. Enable Gzip and Asset Caching

# .htaccess for Miva
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript
</IfModule>

Measuring LCP on Miva

  • PageSpeed Insights -- test homepage, category pages, and product pages
  • Check TTFB -- if over 800ms, focus on server-side caching before frontend optimization
  • Miva admin > Reports shows page view data but not performance metrics; use external tools
  • Test key pages: homepage (hero image), category pages (product grid), product detail pages (main product image)

Analytics Script Impact

Miva's built-in analytics module and third-party extensions should load asynchronously. Check extensions at Admin > Extensions and verify each outputs async scripts.