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โ
| Feature | Setting | Notes |
|---|---|---|
| Script Manager | Enabled | Per-page script disabling |
| Database Cleanup | Enabled | Auto-draft posts, transients, revisions |
| Lazy Loading | Enabled | Images, iframes |
| Local Google Fonts | Enabled | GDPR compliance, avoids Google DNS lookup |
| Disable Embeds | Enabled | Removes WordPress oEmbed overhead |
| Disable WP Emoji | Enabled | Removes emoji CSS/JS |
| Heartbeat | Managed | Disabled 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-accountbypass 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โ
| Asset | Development | Production |
|---|---|---|
Theme CSS (dist/css/global.css) | Source maps included | Minified |
Theme JS (dist/js/global.js) | Unminified | Minified, tree-shaken |
| WooCommerce CSS | Dequeued and replaced by theme CSS | Same |
| NFusion Chart Widget | Development build | Production build |
| Elementor | Standard | Optimized 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)