Benny's Shopware Notebook
  • Introduction
    • How to Get in Touch
  • ddev for Shopware
    • Less than 5 Minutes Install with ddev and Symfony Flex
    • Storefront and Admin Watchers with ddev
    • Message Queue Setup with ddev
    • Contribute with ddev
    • Performance Tweaks
    • RabbitMQ with ddev
    • phpstan pro with ddev
    • Fetch Media from Production or Staging Server
  • Hosting
    • Setting up a Cloud Server with ddev
    • How to Trouble-shoot and Evaluate Environment Variables
    • Media URLs Out Of Sync between Servers
    • RabbitMQ
    • Running Shopware CE with PaaS
    • SFTP-Users
    • Basic-Auth for Shopware 6 with nginx
    • How to Avoid Failed Systemd Units
    • JWT-Secrets as Environment Variables
  • Deployment
    • Close-to-Zero Downtime Deployment
    • Docker-Images for Deployment with Gitlab-Runners
    • PHP Cache Related Issues
  • Development
    • Patching the Core
    • How to Discover Available Updates?
    • Local Testing of Shopware Commercial Features
  • Administration
  • Database
  • Migration
    • Side Effects
Powered by GitBook
On this page
  • Ignoring Timestamps
  • Reset Cache After Deployment
  • ddev and other Local Environments

Was this helpful?

  1. Deployment

PHP Cache Related Issues

This page discusses issues related to (PHP) caching during deployment and what to do about it.

PreviousDocker-Images for Deployment with Gitlab-RunnersNextDevelopment

Last updated 1 year ago

Was this helpful?

The php-fpm configuration for production servers is and should be optimized to use the various caching options. With PHP 7.x and above, there have been a number of improvements, most notably with the introduction of the new file cache. See for a brief overview.

However, these new features have side effects: For example, after deploying, you may find that source changes have not taken effect on your server.

Ignoring Timestamps

In most cases, the cause of these issues is related to the

opcache.validate_timestamps

configuration value. For performance reasons, Shopware recommends to disable it on production servers. See for details.

Reset Cache After Deployment

The easiest and safest way to completely reset opcache is to use the famous . Just request it with composer in your environment:

composer require gordalina/cachetool

Then, assuming your server is equipped with php-fpm, resetting opcache is as simple as running the following command:

vendor/bin/cachetool opcache:reset --fcgi=/var/run/php-fpm.sock

Note that the value of --fcgi depends on your actual web server setup.

ddev and other Local Environments

In local environments, just make sure that opcache file timestamps are always validated by adding the following directive to your php ini file:

opcache.validate_timestamps = 1
here
here
cachetool