Skip to main content
FilterIQRequest access
Menu
Type to search across all documentation
NavigateEnterOpenEscClose
5 min read

Performance

Bundle sizes, loading strategy, and CLS optimization for FilterIQ.

Performance

FilterIQ is engineered for minimal performance impact on your storefront. This page covers bundle sizes, loading strategy, and how we prevent layout shifts.

Bundle Sizes

The Theme App Extension loads these assets on your storefront:

AssetSize (gzip)LoadingPurpose
ssf-critical-layout.css~2KBSynchronousReserves sidebar space, prevents CLS
search-filter.css~3KBSynchronousCore filter and search styling
search-filter.js~15KBDeferredCore initialization, grid detection, filter rendering
instant-search.js~8KBDeferredSearch dropdown widget
instant-search.css~1KBAsyncSearch dropdown styling
mobile-drawer.js~4KBDeferredMobile drawer behavior
mobile-drawer.css~1KBAsyncMobile drawer styling
analytics-client.js~3KBDeferredEvent tracking
accessibility.js~2KBDeferredWCAG enhancements
accessibility.css~0.5KBAsyncFocus styles, screen reader utilities

Total JavaScript: ~32KB gzipped Total CSS: ~7.5KB gzipped

Comparison

AppJS BundleCSS Bundle
FilterIQ~32KB~7.5KB
Industry average (search apps)~80-120KB~15-25KB

Loading Strategy

CSS Loading

CSS is loaded in two tiers:

  1. Critical CSS (ssf-critical-layout.css, search-filter.css) -- Loaded synchronously via stylesheet_tag. These are render-blocking but essential for preventing CLS. Combined size is under 5KB.

  2. Enhancement CSS (instant-search.css, mobile-drawer.css, accessibility.css) -- Loaded asynchronously using the preload/onload pattern. These do not block rendering.

JavaScript Loading

All JavaScript files use the defer attribute, meaning they:

  • Download in parallel with HTML parsing
  • Execute after the DOM is ready
  • Do not block rendering

The execution order is:

  1. search-filter.js -- Core initialization and grid detection
  2. instant-search.js -- Search dropdown setup
  3. mobile-drawer.js -- Mobile drawer setup (only initializes on mobile viewports)
  4. analytics-client.js -- Event tracking
  5. accessibility.js -- WCAG enhancements

Font Loading

The app loads Inter from Google Fonts with display=swap, ensuring text renders immediately with a system font fallback and swaps to Inter when it finishes loading.

CLS Prevention

Cumulative Layout Shift (CLS) is a Core Web Vital that measures visual stability. Adding a filter sidebar to a collection page can cause significant CLS if not handled carefully.

Our CLS Strategy

  1. Inline CLS guard -- The very first thing the embed executes is an inline script that adds a ssf-loading class to <body> and injects a style that hides the product grid container with visibility: hidden. This happens before any external CSS or JS downloads.

  2. Critical layout CSS -- Loaded synchronously, this CSS reserves the exact width the filter sidebar will occupy. The browser allocates space for the sidebar on its first paint.

  3. DOM surgery -- The core JS moves the product grid into a flex container alongside the filter sidebar. Because the grid is hidden during this operation, there is no visible shift.

  4. Reveal -- After DOM surgery is complete, the ssf-loading class is removed and the grid becomes visible in its final position. The entire sequence happens before the user perceives any layout change.

CLS Telemetry

The app includes a CLS telemetry module (ssf-cls-telemetry.js) that measures actual CLS values on your storefront and reports them back to the analytics service. You can monitor CLS impact in Analytics > Performance.

API Performance

OperationTargetTypical
Search query (storefront)< 50ms20-40ms
Autocomplete suggestion< 30ms10-25ms
Filter facet calculation< 20ms5-15ms
Analytics event ingest< 100ms30-60ms
Product webhook processing< 1s200-500ms

Caching

  • Widget config -- Cached in-memory on the backend for 60 seconds per shop
  • Search results -- Cached server-side for fast repeat queries
  • Filter configuration -- Baked into a Shopify metafield (zero-latency storefront reads)

Lighthouse Impact

When properly configured, FilterIQ typically has the following impact on Lighthouse scores:

MetricImpact
LCP (Largest Contentful Paint)Negligible (deferred loading)
FID (First Input Delay)Negligible (non-blocking JS)
CLS (Cumulative Layout Shift)Zero (CLS guard system)
Performance Score-0 to -2 points typical

Optimizing Performance

For fastest loading

  1. Ensure your theme's <head> does not have excessive render-blocking resources
  2. Enable HTTP/2 on your domain (Shopify does this by default)
  3. Use a CDN for custom assets (Shopify CDN handles app extension assets automatically)

For best CLS scores

  1. Keep the Theme App Extension embed enabled (do not toggle it on and off)
  2. Do not add custom CSS that overrides the ssf-loading class behavior
  3. Avoid custom JavaScript that manipulates the product grid DOM before the app initializes
Was this page helpful?