---
title: Best Practices for Shopware Performance | Shopware Community Hub
description: >-
  This section gives tips to optimize Shopware performance with caching,
  database tuning, and efficient server settings for a faster and reliable shop.
canonical_url: 'https://hub.shopware.com/learn/unit/best-practices-for-shopware-performance'
---

# Best Practices for Shopware Performance

<LearningObjectives>

- Identify and implement key Shopware **performance optimization strategies** including caching, database tuning, and server configuration.
- Apply **best practices** for maintaining optimal Shopware shop performance through monitoring, maintenance, and optimization techniques.
- Configure and optimize **critical Shopware components** like lock storage, increment storage, and CDN integration.

</LearningObjectives>

# Best Practices for Shopware Performance

Maintaining optimal performance in Shopware is crucial for ensuring a fast, reliable, and scalable ecommerce platform.

1. Lock Storage:

   - Lock storage manages processes that must not overlap (e.g., avoiding duplicate order processing). Configuring this with Redis or another fast in-memory store prevents race conditions and ensures smooth, concurrent operations.

2. Caching Strategies:

   - Leverage Shopware’s built-in HTTP caching mechanism to store fully rendered pages. This reduces the need for repeated database queries and backend processing, significantly speeding up page load times.
   - Use Redis or Memcached for caching sessions and other transient data. These in-memory caching solutions are faster than traditional file-based caching, improving overall shop responsiveness.

3. Database Optimization:

   - Regularly analyze and optimize database queries. Poorly optimized queries can slow down your shop, especially during high traffic periods.
   - Ensure that your database tables are appropriately indexed. Indexes help speed up data retrieval processes, making your shop more efficient, particularly when handling large volumes of data.
   - Perform regular maintenance tasks like table optimization and clearing outdated data to keep the database lean and fast.

4. Server Configuration:

   - Configure PHP for optimal performance by setting appropriate memory limits, enabling error logging, and using the latest PHP version supported by Shopware.
   - Enable OPcache, a caching engine built into PHP, to store precompiled script bytecode in memory. This reduces the need for PHP to recompile scripts on every request, improving execution speed.
   - Integrate Elasticsearch for advanced search functionalities. Elasticsearch is more efficient than traditional SQL searches for extensive product catalogs, improving search speed and accuracy.

5. Content Delivery Network (CDN):

   - Offload the delivery of static assets like images, CSS files, and JavaScript to a CDN. This reduces the load on your server and accelerates content delivery, especially for users located far from your server.

6. Front-End Optimization:

   - Minify CSS, JavaScript, and HTML files to reduce their size. Compress images using modern formats like WebP to decrease load times.
   - Implement lazy loading for images to defer loading until they are needed. Use asynchronous loading for JavaScript to ensure that scripts don’t block the rendering of the page, leading to faster initial page load times.

7. Monitoring and Maintenance:

   Use tools like New Relic or Shopware’s built-in profiling tools to monitor your shop's performance in real time. Identify and address bottlenecks before they impact your customers.
   Schedule regular tasks such as clearing outdated cache and logs and optimizing the database to maintain optimal performance levels. This prevents the system from slowing down over time due to accumulated data and inefficient processes.

8. Improving Order Throughput

   - The increment storage mechanism in Shopware handles operations that need sequential numbering (e.g., order numbers). Using Redis for increment storage ensures fast, atomic operations that scale well with increasing traffic.
   - Efficiently managing number ranges is crucial for operations like order processing. Misconfigured or poorly managed number ranges can lead to performance bottlenecks, so optimizing their storage and access is important.

Adjust server settings, including PHP limits, database connections, and file system performance, to match the scale of your operations. These tweaks help maximize resource utilization and ensure smooth performance during peak loads. Regular performance maintenance is vital for providing a seamless shopping experience, improving load times, and supporting the growth of your ecommerce business.

For more details, refer to the [Performance](https://developer.shopware.com/docs/guides/hosting/performance/) section of the developer documentation.
