Opcode caching
PHP is an interpreted language. When a PHP script runs, the interpreter compiles the source code into opcode, and then executes it. Opcode caching stores the compiled opcode in memory, so subsequent requests for the same script skip the compilation step entirely. This can significantly speed up PHP applications like WordPress. Our servers support OPcache. To enable it for your account:- Log in to cPanel.
- Go to Select PHP Version (or MultiPHP INI Editor, depending on your server).
- In the extensions list, enable opcache.
When developing and making frequent changes to PHP files, cached opcode can serve stale versions of your scripts for a short time. OPcache re-validates files periodically, but if you need changes visible instantly, you can temporarily disable OPcache while developing.
Expires headers
Expires headers tell browsers how long they can cache static resources (images, CSS, JavaScript) before requesting them again. With proper expires headers, repeat visitors load your site much faster because their browser reuses locally cached files. To add expires headers, edit the .htaccess file in your site’s document root and add:Gzip compression
Gzip compression reduces the size of text-based resources (HTML, CSS, JavaScript) before they are sent to the browser, often by 60-80%. Smaller transfers mean faster page loads, especially on slower connections. To enable gzip compression, add this to your .htaccess file:Already-compressed formats such as JPEG, PNG, and video files should not be gzipped — it wastes CPU for little or no size reduction.
Testing your configuration
After making these changes, you can verify them with tools such as:- GTmetrix — checks expires headers and compression as part of its report
- Google PageSpeed Insights — overall performance scoring
- Browser developer tools (Network tab) — check the Content-Encoding: gzip response header