Foreword
- August 1999: When E-Commerce Was Uncharted Territory
- 2010: Back to Deutsche Telekom
- From Pioneers to Enterprise Standard
- Why This Book?
- Who Is This Book For?
- What to Expect
- After 30 Days
How to Use This Book
- The 30-Day Structure
- How to Proceed
- Code Examples
- Symbols and Conventions
- Target Versions
- Companion Resources
- Feedback
Chapter 1: The Performance Imperative
- Introduction
- The Business Case for Performance
- The Hidden Costs of Slow Stores
- Core Web Vitals: The New Rules of the Game
- The Performance Pyramid
- Case Study: Enterprise E-Commerce — Surviving Peak Traffic
- Checklist: Before You Start
- Summary
- References
Chapter 2: Performance Audit — Where Do You Stand?
- Introduction
- The 7 Performance Dimensions
- Tools for Your Audit
- Establishing a Baseline: The Audit Record
- Identifying Performance Killers
- Practice: Running an Audit
- Example Audit: A Swiss Fashion Shop (fictional)
- Summary
- References
Chapter 3: Measuring and Optimizing Core Web Vitals
- Introduction
- The Three Core Web Vitals
- Step 1: Collecting Field Data
- Step 2: Lab Data with Chrome DevTools
- Step 3: Implementing Quick Wins
- Step 4: Documenting Your Results
- Advanced: Automated Monitoring
- Checklist Days 1-2
- Summary
- References
Chapter 4: Image Optimization
- Introduction
- 4.1 The Shopware 6 Thumbnail System
- 4.2 The sw_thumbnails Tag
- 4.3 Using Lazy Loading Correctly
- 4.4 Enabling WebP and AVIF
- 4.5 Optimizing the Thumbnail Configuration
- 4.6 Optimizing Images Before Upload
- 4.7 Performance Measurement
- Checklist: Days 3-4
- Advanced Tips
- Summary
Chapter 5: Optimizing CSS and JavaScript
- Introduction
- 5.1 Understanding the Problem
- 5.2 CSS Optimization
- 5.3 JavaScript Optimization
- 5.4 Controlling Third-Party Scripts
- 5.5 Theme Compilation
- 5.6 Performance Measurement
- Checklist: Days 5–7
- Summary
- Sources
Chapter 6: HTTP Caching — The Fastest Request Is the One That Never Happens
- Introduction
- 6.1 Understanding HTTP Caching
- 6.2 Checking Shopware’s HTTP Cache
- 6.3 Cache Strategies for Different Page Types
- 6.4 Stale-While-Revalidate: Where It Works — and Where It Does Not
- 6.5 Varnish: The Reverse Proxy in Front of Shopware
- 6.6 Edge Side Includes (ESI)
- 6.7 Cache Invalidation
- 6.8 Cache Debugging
- 6.9 Performance Measurement
- Checklist: Days 8-10
- Summary
- References
Chapter 7: Mastering Shopware’s Application Cache
- Introduction
- 7.1 Understanding the Cache Architecture
- 7.2 Understanding the Default Configuration
- 7.3 Redis as Cache Backend
- 7.4 Sessions in Redis
- 7.5 Cache Invalidation
- 7.6 Cache Warming
- 7.7 Troubleshooting
- 7.8 Performance Measurement
- Checklist: Days 11-12
- Summary
- Sources
Chapter 8: Database Optimization for Shopware
- Introduction
- 8.1 Shopware’s Database Architecture
- 8.2 MySQL/MariaDB Configuration
- 8.3 Slow Query Analysis
- 8.4 Index Optimization
- 8.5 Optimizing the Shopware DAL
- 8.6 Caching Your Own Queries
- 8.7 Shopware Storage Optimization
- 8.8 Database Maintenance
- 8.9 Replication and Read Replicas
- 8.10 Troubleshooting
- Checklist: Day 13-14
- Summary
- References
Chapter 9: Optimizing PHP Performance
- Introduction
- Goal of This Chapter
- Prerequisites
- Step 1: Check and Update PHP Version
- Step 2: Configure OPcache
- Step 2.5: Enable OPcache Preloading
- Step 3: Evaluate the JIT Compiler
- Step 4: Size PHP-FPM
- Step 5: Optimize php.ini for Shopware
- Step 6: Connect Nginx with PHP-FPM
- Step 7: FrankenPHP Outlook
- Troubleshooting
- Checklist: Day 15-16
- Summary
- More Complex Scenario?
- References
Chapter 10: Redis for High Availability
- Introduction
- Goals for This Chapter
- Prerequisites
- Step 1: Understanding the Problem — Single Point of Failure
- Step 2: Choosing the Right Solution — Sentinel vs. Cluster
- Step 3: Building the Redis Sentinel Architecture
- On success
ckquorumreturns a status line that begins withOK. In scripts, check for thatOKonly and not for the full text — the rest of the line is not a guaranteed format. - Step 4: Testing Failover
- Step 5: Configuring Shopware for Sentinel
- Step 6: Setting Up Monitoring and Alerting
- Troubleshooting
- Checklist: Day 17-18
- Summary
- Redis is highly available. In the next chapter (Chapter 11) we integrate a CDN: distribute static assets globally, reduce latency, and take load off the origin server. Because the fastest response is the one that never reaches your server at all.
- More Complex Scenarios?
- References
Chapter 11: CDN Integration for Global Performance
- Introduction
- Prerequisites
- 11.1 How a CDN works
- 11.2 CDN Provider Comparison
- 11.3 Setting up Cloudflare (Recommended)
- 11.4 Configuring Shopware for CDN
- 11.5 Setting Cache Headers Correctly
- 11.6 Cache Invalidation
- 11.7 CDN for Dynamic Content
- 11.8 Image Optimization at the Edge
- 11.9 Security: DDoS and WAF
- 11.10 Measuring Performance
- 11.11 Optimizing Costs
- 11.12 Troubleshooting
- Checklist: Day 19-21
- Summary
- References
Chapter 12: Real User Monitoring (RUM)
- Introduction
- Prerequisites
- 12.1 RUM vs. Synthetic Monitoring
- 12.2 Core Web Vitals
- 12.3 The web-vitals Library
- 12.4 Collecting RUM Data
- 12.5 Evaluating RUM Data
- 12.6 Setting Up Alerting
- 12.7 Interpreting RUM Data
- 12.8 Practical Checklist
- Summary
- References
Chapter 13: Continuous Performance Testing
- Introduction
- Prerequisites
- 13.1 Why Automated Performance Tests?
- 13.2 Lighthouse CI Setup
- 13.3 Defining Performance Budgets
- 13.4 GitHub Actions Integration
- 13.5 GitLab CI Integration
- 13.6 LHCI Server for Trend Analysis
- 13.7 Shopware-Specific Tests
- 13.8 Alerting on Regression
- 13.9 Practical Checklist
- 13.10 Load Testing: k6 and Locust
- Summary
- Sources
Chapter 14: Establishing a Performance Culture in Your Team
- Introduction
- Prerequisites
- 1. Performance as Shared Responsibility
- 2. Establishing Performance Champions
- 3. Code Reviews with a Performance Focus
- 4. Blameless Postmortems
- 5. Continuous Feedback Culture
- 6. Sharing Performance Knowledge
- 7. Organizational Anchoring
- 8. Common Culture Problems and Solutions
- Summary: Week 4, Day 26-27
- References
Chapter 15: The Long-Term Performance Plan
- Introduction
- Prerequisites
- 1. The 12-Month Roadmap
- 2. Quarterly OKRs for Performance
- 3. Managing Technical Debt
- 4. Performance Budgets Long-Term
- 5. Establishing a Maintenance Rhythm
- 6. Scaling Performance Work
- 7. Measuring Success: KPIs for the Full Year
- 8. Avoiding Common Long-Term Mistakes
- Checklist: Day 28-30
- Summary: Day 28-30
- References
Chapter 16: Shopware 6 Themes - Performance Optimization
- Introduction
- Prerequisites
- Companion Repository
- Where the Theme Ends Up
- Understanding and Optimizing theme.json
- SCSS Variables and Bootstrap Overrides
- JavaScript Optimization
- Optimizing Twig Templates
- Implementing Critical CSS
- ESI for Header and Footer (Shopware 6.7)
- Build Tools: Webpack, in 6.7 as Well
- Measuring Theme Performance
- Checklist: Theme Performance
- Avoiding Common Mistakes
- Summary
- References
Chapter 17: Shopware 6 Plugins - Performance Optimization
- Introduction
- Prerequisites
- Companion Repository
- Using the DAL Efficiently
- Optimizing Event Subscribers
- Message Queue for Asynchronous Processing
- Controlling Cache Invalidation
- Optimizing Entity Indexers
- Analyzing Plugin Performance
- Performance Checklist for Plugins
- Summary
- Sources
Chapter 18: Shopware 6 Elasticsearch
- Introduction
- Companion Repository
- 18.1 Elasticsearch vs. MySQL: When Does the Switch Pay Off?
- 18.2 Elasticsearch vs. OpenSearch: Which One to Use?
- 18.3 Heap Configuration: The Most Important Setting
- 18.4 Shopware ES Configuration
- 18.5 Optimizing for the German Language
- 18.6 Customizing Index Mapping
- 18.7 Optimizing Indexing
- 18.8 Query Optimization
- 18.9 Monitoring and Troubleshooting
- 18.10 Migration: From MySQL to Elasticsearch
- 18.11 Advanced: Multi-Index Strategies
- 18.12 Vector & Hybrid Search (ES 8.x forward look)
- Summary
- References
Chapter 19: Mobile Performance
- Introduction
- Companion Repository
- 19.1 Understanding the Mobile Performance Gap
- 19.2 Google Mobile-First Indexing
- 19.3 Mobile Core Web Vitals
- 19.4 Touch Optimization
- 19.5 Responsive Images
- 19.6 Service Worker & Offline Performance
- 19.7 Mobile Checkout Optimization
- 19.8 PWA for Shopware
- 19.9 Network-Aware Loading
- 19.10 Mobile Performance Testing
- Summary
- Sources
Chapter 20: A/B Testing & Performance Experiments
- Goal of This Chapter
- Prerequisites
- Step 1: Define Hypothesis and Metric
- Step 2: Calculate the Sample Size
- Step 3: Assign Visitors Cache-Safely
- Step 4: One Cache Key per Variant
- Step 5: Measurements per Variant from RUM
- Step 6: Analyze Once, at the End
- Practical Example: Load the First Listing Images Immediately
- Common Mistakes in Shopware A/B Tests
- Troubleshooting
- Build vs. Buy: A/B Testing Platforms
- Summary
- Sources
Chapter 21: Third-Party Scripts & Tag Management
- Goal of This Chapter
- Prerequisites
- Step 1: Audit Third-Party Scripts
- Step 2: Load Google Tag Manager After Consent
- Step 3: Clean Up the GTM Container
- Step 4: Consent Mode and Your Own Scripts
- Step 5: Use Partytown for Web Workers
- Step 6: Load Widgets Only on the Pages That Need Them
- Step 7: Monitor the Budget in CI
- Step 8: Check Payment Provider Scripts
- Step 9: Server-Side Tagging with GTM
- Troubleshooting
- Checklist: Third-Party Audit
- Summary
- Sources
Chapter 22: The 20 Most Common Performance Problems
- Overview
- Problem 1: Slow Database Queries
- Problem 2: HTTP Cache Not Active
- Problem 3: Oversized JavaScript Bundles
- Problem 4: Unoptimized Images
- Problem 5: Missing Preconnects
- Problem 6: Render-Blocking CSS
- Problem 7: N+1 Query Problem
- Problem 8: Session Lock Blocking
- Problem 9: Heavy Cart Calculations
- Problem 10: Too Many Plugins
- Problem 11: Elasticsearch Not Configured
- Problem 12: OPcache Not Enabled
- Problem 13: Debug Mode in Production
- Problem 14: Missing Gzip Compression
- Problem 15: Background Processes That Pile Up
- Problem 16: Theme Leftovers
- Problem 17: Large Log Files
- Problem 18: CDN Not Configured
- Problem 19: Synchronous API Calls
- Problem 20: Missing Browser Cache Headers
- Quick Reference: Diagnostic Commands
- Checklist: Performance Troubleshooting
- Summary
Chapter 23: Five Performance Transformation Scenarios
- Introduction
- Case Study 1: Enterprise Telecommunications — Managing a Launch Meltdown
- Case Study 2: Swiss Fashion Shop — Mobile-First Optimization
- Case Study 3: B2B Industrial Supplies — Scaling Search
- Case Study 4: Black Friday Survival — The Night Everything Fell Apart
- Case Study 5: International Marketplace — Scaling Multi-Tenant
- Summary: Patterns Across All Case Studies
- References
Chapter 24: Outlook – New Technologies and Trends
- Introduction
- Core Web Vitals Evolution: INP Replaces FID
- HTTP/3 and QUIC: The New Transport Protocol
- Edge Computing: Running Code Closer to the User
- Shopware Roadmap: What Is Coming?
- AI-Assisted Performance Optimization
- Composable Commerce: The Future of Architecture
- Green IT: Performance as a Sustainability Factor
- Checklist: Future-Proofing
- Summary
Appendix A: Glossary
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- V
- W
- Z
Appendix B: Code Snippets Reference
- PHP / Shopware 6
- Configuration
- JavaScript
- Bash / Shell
- SQL
- Twig
- Additional Snippets
Appendix C: Configurations
- PHP
- Nginx
- Shopware
- MySQL / MariaDB
- Redis
- Supervisor
- Logrotate
- Environment (.env.local)
Appendix D: Resources & Links
- Official Documentation
- Tools
- Books & Articles
- Community & Support
- Services & Hosting
- Companion Repository
- Checklists
Appendix E: Cheat Sheet — Shopware performance at a glance
- Core Web Vitals
- Further metrics (not Core Web Vitals)
- Infrastructure guide values
- Shopware CLI commands
- MySQL/MariaDB
- Redis
- PHP/OPcache
- Configuration paths
- Quick health check
- The 20 most common problems — quick reference
About the Author
- Mehmet Gökçe
- Book Feedback