OPcache stores compiled PHP scripts in memory, so PHP doesn't need to recompile them on every request. It can improve PHP performance by 50–80%.
Check via a phpinfo page:
<?php phpinfo();
Look for an "opcache" section showing "enabled = On".
Or via DirectAdmin → PHP Configuration → check if opcache settings appear.
Add to your .user.ini or ask support to configure server-wide:
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.save_comments=1
For WordPress, set opcache.revalidate_freq=60 (check for file changes every 60 seconds). During development, set it to 0 to always check.
OPcache is cleared on server restart or when files change (depending on revalidate_freq). To manually clear: