Skip to content

Commit

Permalink
add hint on scheduled task for delayed cache invalidation (#1619)
Browse files Browse the repository at this point in the history
* add hint on scheduled task for delayed cache invalidation

* Fix links

---------

Co-authored-by: Micha <[email protected]>
  • Loading branch information
fschmtt and Isengo1989 authored Dec 17, 2024
1 parent fd41147 commit ce62b65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion guides/hosting/performance/performance-tweaks.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ shopware:
A delay for cache invalidation can be activated for systems with a high update frequency for the inventory (products, categories). Once the instruction to delete the cache entries for a specific product or category occurs, they are not deleted instantly but processed by a background task later. Thus, if two processes invalidate the cache in quick succession, the timer for the invalidation of this cache entry will only reset.
By default, the scheduled task will run every 20 seconds, but the interval can be adjusted over the `scheduled_taks` DB table, by setting the `run_interval` to the desired value (it is configured in seconds) for the entry with the name `shopware.invalidate_cache`.

::: warning
If you enable delayed cache invalidation, you must set up a worker to run [Scheduled Tasks](../infrastructure/scheduled-task), e.g., using the [Message Queue](../infrastructure/message-queue).
:::

```yaml
# config/packages/prod/shopware.yaml
shopware:
cache:
invalidation:
delay: 1
delay: 1 # 0 = disabled, 1 = enabled
delay_options:
storage: redis
connection: 'ephemeral' # connection name from redis configuration
Expand Down

0 comments on commit ce62b65

Please sign in to comment.