CLI Overview
Quick Start Guide
wheels info
wheels reload
wheels deps
wheels destroy
wheels watch
wheels generate app
wheels generate app-wizard
wheels generate controller
wheels generate model
wheels generate view
wheels generate property
wheels generate route
wheels generate resource
wheels generate api-resource
wheels generate frontend
wheels generate test
wheels generate snippets
wheels scaffold
wheels db create
wheels db drop
wheels db setup
wheels db reset
wheels db status
wheels db version
wheels db rollback
wheels db seed
wheels db dump
wheels db restore
wheels db shell
wheels db schema
wheels dbmigrate info
wheels dbmigrate latest
wheels dbmigrate up
wheels dbmigrate down
wheels dbmigrate reset
wheels dbmigrate exec
wheels dbmigrate create blank
wheels dbmigrate create table
wheels dbmigrate create column
wheels dbmigrate remove table
wheels test
wheels test run
wheels test coverage
wheels test debug
wheels config list
wheels config set
wheels config env
wheels env
wheels env setup
wheels env list
wheels env switch
wheels environment
wheels console
wheels runner
wheels server
wheels server start
wheels server stop
wheels server restart
wheels server status
wheels server log
wheels server open
wheels plugins
wheels plugins list
wheels plugins install
wheels plugins remove
wheels analyze
wheels analyze code
wheels analyze performance
wheels analyze security
wheels security
wheels security scan
wheels optimize
wheels optimize performance
wheels docs
wheels docs generate
wheels docs serve
wheels ci init
wheels docker init
wheels docker deploy
wheels deploy
wheels deploy audit
wheels deploy exec
wheels deploy hooks
wheels deploy init
wheels deploy lock
wheels deploy logs
wheels deploy proxy
wheels deploy push
wheels deploy rollback
wheels deploy secrets
wheels deploy setup
wheels deploy status
wheels deploy stop
Configuration Management
Creating Commands
Service Architecture
Migrations Guide
Testing Guide
Object Relational Mapping
Creating Records
Reading Records
Updating Records
Deleting Records
Column Statistics
Dynamic Finders
Getting Paginated Data
Associations
Nested Properties
Object Validation
Object Callbacks
Calculated Properties
Transactions
Dirty Records
Soft Delete
Automatic Time Stamps
Using Multiple Data Sources
wheels optimize (Coming Soon)
This command may not work as expected. A complete and stable version is coming soon.
Base command for application optimization.
Synopsis
wheels optimize [subcommand] [options]
Description
The wheels optimize
command provides tools to improve your Wheels application's performance. It analyzes and optimizes various aspects including database queries, asset delivery, caching strategies, and code execution.
Subcommands
| Command | Description |
|---------|-------------|
| performance
| Comprehensive performance optimization |
Options
| Option | Description |
|--------|-------------|
| --help
| Show help information |
| --version
| Show version information |
Direct Usage
When called without subcommands, runs automatic optimizations:
wheels optimize
This performs:
- Database query optimization
- Asset minification and bundling
- Cache configuration
- Code optimization
Examples
Run all optimizations
wheels optimize
Optimize with detailed output
wheels optimize --verbose
Dry run to preview changes
wheels optimize --dry-run
Optimize specific areas
wheels optimize --only=database,assets
Optimization Areas
Database
- Index analysis and creation
- Query optimization
- Connection pooling
- Cache configuration
Assets
- JavaScript minification
- CSS optimization
- Image compression
- Bundle creation
Caching
- Query cache setup
- Page cache configuration
- Object cache optimization
- CDN integration
Code
- Dead code elimination
- Function optimization
- Memory usage reduction
- Startup time improvement
Output Example
Wheels Application Optimization
==============================
Analyzing application...
✓ Scanned 245 files
✓ Analyzed 1,234 queries
✓ Checked 456 assets
Optimizations Applied:
---------------------
Database (4 optimizations)
✓ Added index on users.email
✓ Added composite index on orders(user_id, created_at)
✓ Optimized slow query in ProductModel.cfc
✓ Enabled query caching for static queries
Assets (3 optimizations)
✓ Minified 23 JavaScript files (saved 145KB)
✓ Optimized 15 CSS files (saved 67KB)
✓ Compressed 34 images (saved 2.3MB)
Caching (2 optimizations)
✓ Configured Redis for object caching
✓ Enabled page caching for static routes
Code (3 optimizations)
✓ Removed 12 unused functions
✓ Optimized application startup
✓ Reduced memory footprint by 15%
Performance Impact:
- Page load time: -32% (2.4s → 1.6s)
- Database queries: -45% (avg 23ms → 12ms)
- Memory usage: -15% (512MB → 435MB)
- Startup time: -20% (8s → 6.4s)
Configuration
Configure via .wheels-optimize.json
:
{
"optimize": {
"database": {
"autoIndex": true,
"queryCache": true,
"slowQueryThreshold": 100
},
"assets": {
"minify": true,
"bundle": true,
"compress": true,
"compressionQuality": 85
},
"cache": {
"provider": "redis",
"ttl": 3600,
"autoEvict": true
},
"code": {
"removeDeadCode": true,
"optimizeStartup": true,
"memoryOptimization": true
}
}
}
Optimization Strategies
Development Mode
Focuses on developer experience:
wheels optimize --env=development
- Faster rebuilds
- Source maps preserved
- Debug information retained
Production Mode
Maximum performance:
wheels optimize --env=production
- Aggressive minification
- Dead code elimination
- Maximum compression
Balanced Mode
Balance between size and debuggability:
wheels optimize --mode=balanced
Advanced Options
Selective Optimization
# Only database optimizations
wheels optimize --only=database
# Exclude asset optimization
wheels optimize --skip=assets
# Specific optimizations
wheels optimize --optimizations=minify,compress,index
Performance Budgets
# Set performance budgets
wheels optimize --budget-js=200kb --budget-css=50kb
# Fail if budgets exceeded
wheels optimize --strict-budgets
Integration
Build Process
{
"scripts": {
"build": "wheels optimize --env=production",
"build:dev": "wheels optimize --env=development"
}
}
CI/CD Pipeline
- name: Optimize application
run: |
wheels optimize --env=production
wheels optimize --verify
Optimization Reports
Generate Report
wheels optimize --report=optimization-report.html
Report Contents
- Before/after metrics
- Optimization details
- Performance graphs
- Recommendations
Rollback
If optimizations cause issues:
# Create backup before optimizing
wheels optimize --backup
# Rollback to backup
wheels optimize --rollback
# Rollback specific optimization
wheels optimize --rollback=database
Best Practices
- Test After Optimization: Verify functionality
- Monitor Performance: Track real-world impact
- Incremental Approach: Optimize gradually
- Keep Backups: Enable rollback capability
- Document Changes: Track what was optimized
Performance Monitoring
After optimization:
# Verify optimizations
wheels optimize --verify
# Performance benchmark
wheels optimize --benchmark
# Compare before/after
wheels optimize --compare
Common Issues
Over-optimization
- Breaking functionality
- Debugging difficulties
- Longer build times
Solutions
- Use balanced mode
- Keep source maps in development
- Test thoroughly
Use Cases
- Pre-deployment: Optimize before production
- Performance Issues: Fix slow applications
- Cost Reduction: Reduce resource usage
- User Experience: Improve load times
- Scalability: Prepare for growth
Notes
- Always backup before optimization
- Some optimizations require restart
- Monitor application after optimization
- Optimization impact varies by application
See Also
- wheels optimize performance - Detailed performance optimization
- wheels analyze performance - Performance analysis
- wheels cache - Cache management
- wheels config - Configuration management
- Synopsis
- Subcommands
- Options
- Direct Usage
- Examples
- Run all optimizations
- Optimize with detailed output
- Dry run to preview changes
- Optimize specific areas
- Optimization Areas
- Database
- Assets
- Caching
- Code
- Output Example
- Configuration
- Optimization Strategies
- Development Mode
- Production Mode
- Balanced Mode
- Advanced Options
- Selective Optimization
- Performance Budgets
- Integration
- Build Process
- CI/CD Pipeline
- Optimization Reports
- Generate Report
- Report Contents
- Rollback
- Best Practices
- Performance Monitoring
- Common Issues
- Over-optimization
- Solutions
- Use Cases
- Notes
- See Also