Any reason not to enable OPCache on all (WordPress) sites?
Hi all,
I've been using shared hosting for years, but am currently migrating some of my WordPress sites to Digital Ocean through Laravel Forge.
I went through the entire Laracasts course and an option that seemed very interesting to me was OPCache. I noticed this option isn't enabled by default, so I was just wondering if there is any downside to enable this on all my (WordPress) servers?
OPCache is a great tool for improving the performance of your WordPress sites, and there is no downside to enabling it on all your servers. OPCache can help reduce the amount of time it takes for your server to process requests, as it stores precompiled script bytecode in memory, which eliminates the need to parse and compile scripts on each request.
To enable OPCache, you can add the following to your php.ini file:
Do I really need a WordPress plugin though, or should everything work out of the box? I understand I may need to restart PHP FPM when I edit some PHP-files directly on the server, but does this happen automatically when I install new plugins, themes, etc on the WordPress dashboard?
@t-stark Hey, I'm in the same position. Recently moved some WordPress sites onto Forge (via Digital Ocean) , I haven't switched on OPCache yet. Did you ever get an answer for this, other than Lary? :-) I install plugins and edit all PHP files locally and then deploy using a BitBucket repo, so in theory the deployment script in Forge restarts PHP FPM. I'm not sure why you would need a dedicated WP plugin for this.