You are currently viewing the article on an older Shopware version!
Please note that this article is only for users of a self-hosted store. This is not relevant for users of a Shopware 6 SaaS environment.
In the module Caches & Indexes you are able to empty and warm up the cache. It also gives you an overview of some system configurations.
In the overview you will get the information whether your shop is used in productive mode. This is indicated by the entry "Production" in the Environment (1).
You can also see here whether the HTTP cache is active (2) and which cache adapter (3) is used.
You can adjust the environment mode and HTTP cache in the .env file in the Shopware main directory.
For more information on how to customize the environment settings, click here.
SHOPWARE_HTTP_CACHE_ENABLED=1
activated. (=0) deactivates the cache.
In the lower part of the module, you have different functions for the cache and the indexes.
Clear caches (4)
This can be used to empty the caches without having to reheat them directly afterwards.
This is also available in the console.
php bin/console cache:clear
Clear and warm up caches (5)
First, a new cache is created. The old cache is removed after the new cache has been created.
Indexes (6)
Updates the indexes such as the category and product indexes and the SEO URLs.
In the console, this can be done using the command
php bin/console dal:refresh:index
Use the dropdown menu (7) to select all indices that should not be updated when updating indices. Below, you'll find a list of all entries and their descriptions. All entries with a "-" is a subprocess to the index above. If a main index is checked, all subindexes will be checked.
Indizes | Description |
category.indexer | Creates an index for the categories |
- category.child-count | Creates an index with a count of subcategories |
- category.tree | Creates an index of the category tree (categories and their subcategories) |
- category.breadcrumb | Creates an index of the category tree to use it in the breadcrumb bar |
- category.seo-url | Creates an index of the seo-urls of the categories |
customer.indexer | Creates a search index of the customers |
- customer.many-to-many-id-field | Supporting task to join the tables |
landing_page.indexer | Creates an index of all landing pages |
- landing_page.many-to-many-id-field | Supporting task to join the tables |
- landing_page.seo-url | Creates an index of the seo-urls of the landing pages |
media.indexer | Creates an index of the media files |
- media_folder.indexer | Creates an index of the media folders |
- media_folder.child-count | Counts the subfolders within the media folder |
media_folder_configuration.indexer | Updates the configs of subfolders according the master media folder |
payment_method.indexer | Creates an index of the payment methods |
product.indexer | Creates an index of all products |
- product.inheritance | Updates the connections between products and their variants. |
- product.stock | Indexes the available stock of the products |
- product.variant-listing | Creates an index of all variants in the products |
- product.child-count | Counts the variants |
- product.many-to-many-id-field | Supporting task to join the tables |
- product.category-denormalizer | Checks for abandoned products in categories(dead links) and removes them. |
- product.cheapest-price | Determines the cheapest price within the products |
- product.rating-averaget | Creates an average of the rating points of the product reviews |
- product.stream | Creates the product listings for the dynamic product groups |
- product.search-keyword | Defines a list of all search-keywords of the products |
- product.seo-url | Creates a list of seo-urls of the products |
product_stream.indexer | Creates an index of the dynamic product groups |
product_stream_mapping.indexer | Creates an index of mapping between categories and dynamic product groups |
promotion.indexer | Creates an index of the promotions |
- promotion.exclusion | Creates an index of exclusions within the promotions (Do not combine with...) |
- promotion.redemption | Updates the list of promotions used by customers |
rule.indexer | Creates an index of the Rules within the Rule Builder |
- rule.payload | Creates an index of conditions in the rules |
sales_channel.indexer | Creates an index of all sales channels |
- sales_channel.many-to-many | Supporting task to join the tables |
flow.indexer | Creates an index of all flows in the Flow Builder |
newsletter_recipient.indexer | Creates an index of newsletter-recipients |
In Shopware 6 Standard, the cache is not cleared automatically. In the long run, this can lead to the Shopware installation becoming larger and larger and requiring more and more space on the server.
To clear the cache of the shop manually, you can use the Shopware CLI. How to use the Shopware CLI you can also find here.
To clear your cache, you can use the following command in the Shopware CLI:
php bin/console cache:clear
On a live system, we recommend that after clearing a cache, you also warm it up again. You can warm up the cache with the following command:
php bin/console cache:warmup
So that these commands do not have to be executed manually at regular intervals, we recommend executing them via cronjob once a day. This should be executed when the traffic on the shop is at its lowest. This can then always be done at night, for example. How you can set up a regular cronjob on a Linux server, for example, can be found here.
If the cache can not be deleted via the Shopware CLI command, you can try to delete the cache folders manually with the following command:
rm -rf SHOPWARE-ROOT-FOLDER/var/cache/*
The cache in Shopware 6 stores data with the purpose of speeding up future requests. Basically, the data stored in a cache can be the result of a previous interaction with websites. A Shopware 6 index is a list of data stored in a simple text format. In most cases, indexes represent a group of files or database records that are quickly searched by a search algorithm. Consequently, search and sorting operations are greatly improved, resulting in new levels of performance.