Skip to main content

Performance Configuration

Scottsdale Mint uses several performance optimization tools and strategies to maintain fast page loads despite real-time precious metals pricing updates and high product catalog volume.


Perfmattersโ€‹

Plugin: perfmatters (with web/app/mu-plugins/a-suma-perfmatters-filters.php override)

Perfmatters provides granular control over which scripts, styles, and features are loaded on each page.

Cache Path Overrideโ€‹

The MU plugin overrides the default cache directory:

// a-suma-perfmatters-filters.php
add_filter( 'perfmatters_cache_path', function() {
return WP_CONTENT_DIR . '/uploads/perfmatters/cache/';
} );

This puts the cache inside /uploads/ which is mapped to S3 on Ymir, ensuring cache files persist across Lambda invocations.

Features Configuredโ€‹

FeatureSettingNotes
Script ManagerEnabledPer-page script disabling
Database CleanupEnabledAuto-draft posts, transients, revisions
Lazy LoadingEnabledImages, iframes
Local Google FontsEnabledGDPR compliance, avoids Google DNS lookup
Disable EmbedsEnabledRemoves WordPress oEmbed overhead
Disable WP EmojiEnabledRemoves emoji CSS/JS
HeartbeatManagedDisabled on front-end, controlled on admin

Scalability Proโ€‹

Plugin: scalability-pro

Addresses WooCommerce performance issues at scale.

Key Optimizationsโ€‹

Deferred Term Counts:

  • WooCommerce normally updates product category and tag counts on every order and stock change
  • With large catalogs, this causes database lock contention
  • Scalability Pro defers count updates to run asynchronously

Query Optimization:

  • Optimizes complex WooCommerce meta queries
  • Reduces query count on product listing pages

Object Cache Pro (Redis)โ€‹

See Caching Architecture for full Redis configuration details.

Key performance settings:

define( 'WP_REDIS_IGBINARY', true );      // 50-70% smaller serialized objects vs PHP serialize
define( 'WP_REDIS_COMPRESSION', 'zstd' ); // Fast compression, high ratio
define( 'WP_REDIS_CONFIG', [
'split_alloptions' => true, // Prevents single large cache key stampedes
'prefetch' => false, // Avoids loading all alloptions on every request
] );

CloudFront CDNโ€‹

See Caching Architecture for CloudFront setup.

Key performance settings in ymir.yml:

  • image_processing: true โ€” On-the-fly image resizing at CloudFront edge
  • Cookie whitelist โ€” Only WooCommerce session cookies bust cache (prevents unnecessary cache misses)
  • Excluded paths โ€” Only /cart, /checkout, /my-account bypass cache

WordPress Core Performance Constantsโ€‹

// No post revisions (saves DB rows)
define( 'WP_POST_REVISIONS', false );

// Effectively disables autosave (reduces DB writes)
define( 'AUTOSAVE_INTERVAL', 9999999 );

// Yoast redirects handled at CDN/server level
define( 'WPSEO_DISABLE_PHP_REDIRECTS', true );

// External cron (no page-load overhead for scheduled tasks)
define( 'DISABLE_WP_CRON', true );

Image Optimizationโ€‹

Plugin: tiny-compress-images (TinyPNG/TinyJPG integration)

  • Images are automatically compressed on upload via TinyPNG API
  • CloudFront CloudFront handles responsive image resizing at the edge
  • Perfmatters lazy-loads images below the fold

WooCommerce Performanceโ€‹

Reserved Stock Proโ€‹

Plugin: reserved-stock-pro

During checkout, this plugin temporarily reserves stock for items in an active cart/checkout session. This prevents overselling on high-demand products without immediately decrementing the publicly-visible stock count.

Disable WooCommerce Blocks (mu-plugins/disable-woocommerce-block.php)โ€‹

WooCommerce ships with block-editor-based cart and checkout. These blocks are disabled to use the classic PHP-template-based checkout (which integrates with all custom payment gateways).

add_filter( 'woocommerce_block_template_area_is_active', '__return_false' );

WC Legacy REST APIโ€‹

The woocommerce-legacy-rest-api plugin is included to maintain backward compatibility with external integrations that use the v1/v2 WC REST API.


Development vs Production Asset Loadingโ€‹

AssetDevelopmentProduction
Theme CSS (dist/css/global.css)Source maps includedMinified
Theme JS (dist/js/global.js)UnminifiedMinified, tree-shaken
WooCommerce CSSDequeued and replaced by theme CSSSame
NFusion Chart WidgetDevelopment buildProduction build
ElementorStandardOptimized via Perfmatters script manager

Assets are compiled via Webpack Mix:

npm run dev        # Development (source maps, watch mode)
npm run production # Production (minified, tree-shaken)