Scheduled tasks
P2Lab Cache registers three Shopware scheduled tasks. They are dispatched by the standard scheduler worker, so they only fire when one of these is running:
bin/console messenger:consume schedulerMost production setups already run a scheduler — these tasks plug in transparently.
The three tasks
Section titled “The three tasks”p2lab_cache.cleanup_cache_entries
Section titled “p2lab_cache.cleanup_cache_entries”Drops orphaned rows from the p2lab_cache_entry metadata table — entries that no longer have a corresponding payload in the backend (e.g. because the backend evicted them by TTL, or because the backend was switched).
Default interval: nightly (24 h) Why it matters: keeps the metadata table aligned with the actual backend; dashboard counts stay accurate.
p2lab_cache.cleanup_invalidation_log
Section titled “p2lab_cache.cleanup_invalidation_log”Deletes rows in the p2lab_cache_invalidation_log table older than 30 days.
Default interval: nightly (24 h) Why it matters: the log can grow large on a busy store. The fixed 30-day retention keeps it useful for diagnosis without ballooning.
p2lab_cache.cleanup_reverse_proxy_log
Section titled “p2lab_cache.cleanup_reverse_proxy_log”Deletes rows in the p2lab_cache_reverse_proxy_log table older than 30 days. Same shape as the invalidation log cleanup.
Default interval: nightly (24 h)
Verifying tasks are registered
Section titled “Verifying tasks are registered”bin/console scheduled-task:listLook for the three p2lab_cache.* entries. If they are missing, the plugin isn’t fully activated — run:
bin/console plugin:refreshbin/console plugin:install --activate --refresh P2LabCachebin/console cache:clearChanging the interval
Section titled “Changing the interval”Shopware lets you edit the run interval per task from Settings → System → Scheduled tasks, or directly in the scheduled_task table. Pick a longer interval if your log tables are small and a daily wakeup is wasteful.
Running a task manually
Section titled “Running a task manually”To force a task to run once without waiting for the scheduler:
bin/console scheduled-task:run-single p2lab_cache.cleanup_invalidation_logUseful in scripts that wipe logs after a maintenance window.