Settings
Complete configuration reference for SpeedMate.
Settings Overview
SpeedMate settings are stored in WordPress options table under speedmate_settings key.
Access Methods
1. WordPress Admin
Navigate to Settings > SpeedMate to configure via GUI.
2. Programmatic
// Get all settings
$settings = get_option('speedmate_settings', []);
// Update settings
update_option('speedmate_settings', [
'mode' => 'beast',
'cache_ttl' => 3600,
]);3. WP-CLI
# View settings
wp option get speedmate_settings --format=json
# Update setting
wp option update speedmate_settings --format=json < settings.json4. REST API
# Get settings
curl https://site.com/wp-json/speedmate/v1/settings
# Update settings (requires nonce)
curl -X POST https://site.com/wp-json/speedmate/v1/settings \
-H "X-WP-Nonce: $NONCE" \
-d '{"mode":"beast","cache_ttl":3600}'Core Settings
Mode
Cache operation mode.
Type: string
Options: disabled, static, beast
Default: disabled
'mode' => 'beast'disabled: No cachingstatic: Manual static cache onlybeast: Automatic intelligent caching
Cache TTL
Time-to-live for cached pages in seconds.
Type: int
Default: 3600 (1 hour)
'cache_ttl' => 3600Common values:
1800- 30 minutes (dynamic content)3600- 1 hour (standard)86400- 24 hours (static content)
Gzip Compression
Enable gzip compression for cached files.
Type: bool
Default: true
'gzip_enabled' => trueReduces file size by 60-80%.
Beast Mode Settings
Beast Threshold
Minimum score required for auto-caching.
Type: int
Default: 50
'beast_threshold' => 50Lower = more aggressive caching
Beast Time Window
Time window for traffic analysis in seconds.
Type: int
Default: 3600 (1 hour)
'beast_time_window' => 3600Beast Whitelist
URL patterns to always cache.
Type: array
Default: []
'beast_whitelist' => [
'/blog/*',
'/category/*',
'/tag/*',
]Supports wildcards: *, ?
Beast Blacklist
URL patterns to never cache.
Type: array
Default: []
'beast_blacklist' => [
'/checkout/*',
'/cart/*',
'/my-account/*',
]Media Settings
WebP Enabled
Enable WebP conversion.
Type: bool
Default: true
'webp_enabled' => trueAVIF Enabled
Enable AVIF conversion.
Type: bool
Default: true
'avif_enabled' => trueWebP Quality
WebP compression quality (0-100).
Type: int
Default: 85
'webp_quality' => 85Lazy Load
Enable lazy loading for images.
Type: bool
Default: true
'lazy_load' => trueLazy Threshold
Distance in pixels before loading.
Type: int
Default: 200
'lazy_threshold' => 200Performance Settings
Critical CSS Enabled
Enable critical CSS extraction.
Type: bool
Default: true
'critical_css_enabled' => trueCritical Viewport Height
Viewport height for critical CSS extraction.
Type: int
Default: 1080
'critical_viewport_height' => 1080Preload Enabled
Enable resource hints.
Type: bool
Default: true
'preload_enabled' => trueDNS Prefetch
Domains for DNS prefetch.
Type: array
Default: []
'dns_prefetch' => [
'fonts.googleapis.com',
'cdn.example.com',
]Preconnect
Domains for preconnect.
Type: array
Default: []
'preconnect' => [
'https://fonts.googleapis.com',
'https://fonts.gstatic.com',
]Traffic Warmer Settings
Traffic Warmer Enabled
Enable traffic warmer.
Type: bool
Default: false
'traffic_warmer_enabled' => trueWarm Strategy
Warming strategy.
Type: string
Options: on-visit, scheduled, idle
Default: on-visit
'warm_strategy' => 'on-visit'Warm Concurrent
Concurrent warm requests.
Type: int
Default: 3
Range: 1-10
'warm_concurrent' => 3Warm Delay
Delay between requests in milliseconds.
Type: int
Default: 500
'warm_delay' => 500Logging Settings
Logging Enabled
Enable structured logging.
Type: bool
Default: false
'logging_enabled' => trueNote: Disable in production for performance.
Log Level
Logging level.
Type: string
Options: debug, info, warning, error
Default: info
'log_level' => 'info'Log File
Custom log file path.
Type: string
Default: wp-content/speedmate.log
'log_file' => WP_CONTENT_DIR . '/logs/speedmate.log'Advanced Settings
Cache Logged In
Cache pages for logged-in users.
Type: bool
Default: false
'cache_logged_in' => falseWarning: May leak user-specific content.
Cache Query Strings
Cache pages with query strings.
Type: bool
Default: true
'cache_query_strings' => trueExclude Patterns
URL patterns to exclude from cache.
Type: array
Default: []
'exclude_patterns' => [
'/wp-admin/*',
'/wp-login.php',
'/*preview=*',
]User Agent Groups
Group user agents for separate caches.
Type: array
Default: ['mobile', 'desktop']
'user_agent_groups' => [
'mobile' => ['iPhone', 'Android'],
'desktop' => [],
]Multisite Settings
Network Settings
Network-wide defaults:
// In wp-config.php
define('SPEEDMATE_NETWORK_MODE', 'beast');
define('SPEEDMATE_NETWORK_TTL', 3600);Per-Site Override
// Site-specific settings
switch_to_blog(2);
update_option('speedmate_settings', [
'mode' => 'static', // Override network default
]);
restore_current_blog();Import/Export
Export Settings
# Via WP-CLI
wp option get speedmate_settings --format=json > speedmate-settings.json
# Via REST API
curl https://site.com/wp-json/speedmate/v1/settings > settings.jsonImport Settings
# Via WP-CLI
wp option update speedmate_settings --format=json < speedmate-settings.json
# Via WordPress Admin
# Settings > SpeedMate > Import/Export > Choose FileConfiguration Examples
High-Traffic Blog
update_option('speedmate_settings', [
'mode' => 'beast',
'cache_ttl' => 3600,
'beast_threshold' => 30,
'beast_whitelist' => ['/', '/blog/*', '/category/*'],
'webp_enabled' => true,
'critical_css_enabled' => true,
'traffic_warmer_enabled' => true,
'warm_strategy' => 'on-visit',
]);E-Commerce Site
update_option('speedmate_settings', [
'mode' => 'beast',
'cache_ttl' => 1800,
'beast_blacklist' => ['/checkout/*', '/cart/*', '/my-account/*'],
'cache_logged_in' => false,
'webp_enabled' => true,
'lazy_load' => true,
]);Corporate Site
update_option('speedmate_settings', [
'mode' => 'static',
'cache_ttl' => 86400,
'webp_enabled' => true,
'critical_css_enabled' => true,
'preload_enabled' => true,
'dns_prefetch' => ['fonts.googleapis.com'],
]);Validation
Settings are validated on save:
add_filter('speedmate_validate_settings', function($settings) {
// Ensure TTL is positive
if (isset($settings['cache_ttl']) && $settings['cache_ttl'] < 0) {
$settings['cache_ttl'] = 3600;
}
// Ensure quality is 0-100
if (isset($settings['webp_quality'])) {
$settings['webp_quality'] = max(0, min(100, $settings['webp_quality']));
}
return $settings;
});