> 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

<figure><img src="/files/bHYzod61W9BtJ7dM7fQA" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
