Optimise website performance
Turn PHP opcode caching on or off so PHP can reuse compiled code instead of rebuilding it on every request.
Where Websites โ your website โ Advanced โ Optimisation
What this is for
- Understand the Opcode caching switch shown by Enhance.
- Reduce repeat PHP compilation work.
- Turn the cache off temporarily when diagnosing a code-caching problem.
Before you start
- Record whether Opcode caching is currently on or off.
- If this is a production site, make the change at a quiet time and have the previous setting ready.
Take care
This switch is not a page-cache purge button. WordPress cache plugins, LiteSpeed cache and external CDNs must be managed separately.
Steps
-
1
Open Websites, select the correct website and open Advanced across the top.
-
2
Choose Optimization from the drop-down menu.
-
3
Read the Opcode caching card and note whether its switch is currently on or off.
-
4
Turn the switch on for normal production use. Enhance will cache compiled PHP operation code; it does not cache complete webpages or customer sessions.
-
5
If a developer asks you to rule out an opcode-cache problem, turn it off briefly, reproduce the problem and then restore the original setting.
-
6
After a change, open the public site and WordPress Admin and confirm PHP pages load normally.
Check it worked
- The switch remains in the intended position after refreshing the page.
- Public PHP pages and WordPress Admin load normally, with no new entry in php-error.log.
What the controls do
| Control | What it means |
|---|---|
| Opcode caching | Stores compiled PHP instructions in memory so the server does not need to compile unchanged PHP files for every request. |
| On | Recommended for normal operation because it can reduce PHP processing work. |
| Off | Useful only as a temporary diagnostic step when recently changed PHP code appears not to be running. |