Speed and caching1 min readUpdated

OPcache: why code changes sometimes do not show

PHP keeps compiled code in memory. When that helps, when it hides your changes and how to empty it.

OPcache keeps compiled PHP in memory so PHP does not read and compile every file on every request. It makes every PHP site noticeably faster.

Why changes may not show

With opcache.validate_timestamps On (the default) PHP checks files for changes every 2 seconds, so uploads show almost at once. If you turned it Off for speed, PHP never checks: changed files only show after OPcache is emptied.

Empty OPcache

  • Actions tab, Reset OPcache (every platform).
  • Every action on the Actions tab ends by reloading PHP, which empties OPcache too.
  • Deploys from the console reload PHP at the end.

Turn validate_timestamps off only on stores that deploy through the console or Git; leave it on when developers upload files by SFTP.

Did this solve it? If not, tell us what you see and we look at your server.

Open a ticket

Still stuck? Ask a person.

Tickets go straight to the engineers who run ShopWhizzy servers. Tell us the store, what you see and when it started, and we take it from there.