> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/hosting/elements-hosting-reactor-panel/websites/manage-websites/optimization.md).

# Optimization

Speed up your PHP pages with Opcode caching

<figure><img src="https://410055788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1wrnfhRFfBQTaZF2M5d8%2Fuploads%2FGVAVBNnh5DaTz8rbRkS6%2F01-optimization.webp?alt=media&amp;token=19991065-18b4-42b8-950b-ae2c67c6f074" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**tl;dr**: Keep this setting enabled, there is effectively no downside and it provides clear performance benefits.
{% endhint %}

### What OPcache is

OPcache is a PHP optimization feature that speeds up how PHP code runs on your site.

Normally, every time PHP is executed, the server must read the PHP file, analyze the code, compile it into low-level instructions, and then run it. This process happens on every request.

With OPcache enabled, PHP is compiled once and the compiled code is stored in server memory. Future requests reuse this already-compiled code instead of repeating the compilation process.

### Why OPcache matters on Elements Hosting

Elements Hosting uses PHP-FPM to run PHP for supported features such as contact forms, our Blog/CMS system, certain components, and other dynamic functionality used by RapidWeaver Elements sites.

OPcache reduces the work PHP needs to do for each request, which results in faster execution and lower CPU usage. This helps keep sites responsive and stable, especially during traffic spikes.

### How it affects RapidWeaver sites

Most RapidWeaver Elements sites are primarily static HTML, which is already very fast. However, PHP is still used for common features such as:

* Contact form pages
* Blog/CMS pages
* Other pages/components requiring the .php extension to work properly

When OPcache is enabled, these PHP components execute more efficiently, improving page interactions and form responsiveness without changing how your site works.

### What OPcache does and does not do

OPcache improves PHP execution speed, but it is important to understand its scope.

OPcache does:

* Speed up PHP execution
* Reduce CPU usage
* Improve performance consistency under load

OPcache does not:

* Cache HTML pages
* Skip PHP execution
* Reduce database queries

Your PHP code still runs on every request. It simply runs faster because it does not need to be recompiled each time.

### Recommended setting

OPcache should be enabled for all production sites hosted on Elements Hosting.

For RapidWeaver Elements sites, there is effectively no downside and clear performance benefits.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements-docs/hosting/elements-hosting-reactor-panel/websites/manage-websites/optimization.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
