Shopware 6 Developer Performance Guide - Essential Improvements and Fixes
Performance optimization is crucial for any e-commerce platform. Here are the most impactful performance improvements and fixes for Shopware 6 developers.

Introduction
Performance optimization is crucial for any e-commerce platform. Here are the most impactful performance improvements and fixes for Shopware 6 developers. These optimizations can significantly improve your store's loading times and user experience.
1. Enable HTTP Cache
The HTTP cache is your first line of defense for performance. Configure it properly in your .env file:
SHOPWARE_HTTP_CACHE_ENABLED=1
SHOPWARE_HTTP_DEFAULT_TTL=7200
For dynamic content, use cache invalidation strategically:
use Shopware\Core\Framework\Adapter\Cache\CacheInvalidator;
$this->cacheInvalidator->invalidate([
'product-' . $productId,
'navigation'
]);
2. Optimize Database Queries
Avoid N+1 queries by using associations properly:
// Bad: Multiple queries
$products = $this->productRepository->search($criteria, $context);
foreach ($products as $product) {
$manufacturer = $product->getManufacturer(); // Extra query per product
}
// Good: Single query with associations
$criteria->addAssociation('manufacturer');
$products = $this->productRepository->search($criteria, $context);
3. Use Entity Search for Better Performance
Leverage the DAL (Data Abstraction Layer) efficiently:
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('active', true));
$criteria->setLimit(20);
$criteria->setOffset(0);
// Add only needed associations
$criteria->addAssociation('cover');
$products = $this->productRepository->search($criteria, $context);
4. Implement Proper Indexing
Ensure your custom entities are indexed correctly:
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexer;
class CustomEntityIndexer extends EntityIndexer
{
public function update(EntityWrittenContainerEvent $event): void
{
// Implement efficient indexing logic
}
}
5. Optimize Asset Loading
Minimize JavaScript and CSS by configuring the theme properly:
// In your theme's webpack configuration
module.exports = {
optimization: {
minimize: true,
splitChunks: {
chunks: 'all',
},
},
}
6. Use Message Queue for Heavy Operations
Offload time-consuming tasks to the message queue:
$this->messageBus->dispatch(
new ProductExportMessage($exportId)
);
Configure workers in your deployment:
php bin/console messenger:consume async --time-limit=3600
7. Enable Redis for Cache and Sessions
Configure Redis in .env:
REDIS_CACHE_HOST=127.0.0.1
REDIS_CACHE_PORT=6379
APP_CACHE_ADAPTER=cache.adapter.redis
SESSION_HANDLER=redis
SESSION_HANDLER_ID=redis://127.0.0.1:6379
8. Database Connection Pooling
Use persistent connections for better database performance:
# config/packages/doctrine.yaml
doctrine:
dbal:
options:
!php/const PDO::ATTR_PERSISTENT: true
9. Profiler Management
Disable the profiler in production:
APP_ENV=prod
SHOPWARE_PROFILER_ENABLED=0
10. CDN Integration
Serve static assets through a CDN by configuring your shopware.yaml:
shopware:
cdn:
url: 'https://cdn.your-domain.com'
strategy: 'physical_filename'
Key Performance Metrics to Monitor
- Time to First Byte (TTFB): Should be under 200ms
- Page Load Time: Target under 2 seconds
- Database Query Time: Keep under 50ms per request
- Cache Hit Ratio: Aim for 80%+
Quick Wins Checklist
- ✓ Enable HTTP cache
- ✓ Configure Redis
- ✓ Optimize images (WebP format)
- ✓ Enable lazy loading for images
- ✓ Minify CSS and JavaScript
- ✓ Use proper indexing
- ✓ Implement message queues
- ✓ Monitor slow queries
Useful Reference Links
- Official Shopware 6 Performance Guide
- Shopware 6 Cache Documentation
- DAL Best Practices
- Message Queue Documentation
- Redis Configuration Guide
Conclusion
Performance optimization is an ongoing process. Start with the quick wins like enabling HTTP cache and Redis, then gradually implement more advanced optimizations. Always measure before and after to validate your improvements.
Remember: Premature optimization is the root of all evil, but ignoring performance is the root of all user frustration.
Enjoyed this?
Get new posts as they land.
Keep reading

531 Requests on a Homepage — Cutting a Headless Storefront Down to 101
A headless Shopware 6 + Nuxt storefront loaded 531 requests on its mobile homepage and scored 56 in Lighthouse. After one batch of changes on production it was 101 requests and 88. How I measured, where the weight came from, what I reverted, and a checklist for your own storefront.

Shareable Product Configurator in Shopware 6 — State in the URL
How I built a product configurator for a Shopware 6 storefront where the whole state lives in a ?cfg= URL parameter — what to serialize, how the PDF export works, what breaks, and the trade-offs of letting users edit a shared configuration.

Shopware 6 Meets AI Agents - What an MCP Server for Your Shop Could Do
MCP gives AI agents a standard way to talk to real systems. Here's what an MCP server over Shopware's Admin API could look like - the tool surface, the architecture, and the honest risks of letting an agent near a live shop.