> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.faaaster.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How do I exclude a page from the cache on Faaaster?

To make sure a page is never served from the server cache, add its address to your site's `conf/cache.user.conf` file, then click **Restart PHP / Nginx** in the **Actions** menu. The same `conf` folder also lets you exclude from the cache based on a cookie, have URL parameters ignored, and set the cache duration.

> **Prerequisite** — the **File Editor** (**Access** tab) or SFTP access. The `conf` folder is at the root, next to the `www` folder. It remains editable when read-only mode is on.

## Excluding a page or a section from the cache

1. Open the site, **Access** tab, **File Editor** section, then the `conf` folder.
2. Create the `cache.user.conf` file if it doesn't exist.
3. Add one line per rule:

```
~^/cart/ 1;
~^/my-account/ 1;
/contact/ 1;
```

4. In the **Actions** menu, click **Restart PHP / Nginx**.

`~^/cart/` excludes all addresses that start with `/cart/`. Without `~`, `/contact/` only excludes that exact address. Each line ends with ` 1;`.

> ⚠️ **Only write rules ending in `1`.** An overly broad rule like `~/ 1;` disables the cache for the whole site.

## Excluding from the cache based on a cookie

The `conf/cookiescachebypass.user.conf` file already contains the WordPress login cookies and the cart cookies of the main e-commerce plugins. To exclude visitors who carry your own cookie from the cache, add a line without removing the existing lines:

```
~my_cookie 1;
```

Then click **Restart PHP / Nginx** in the **Actions** menu.

## URL parameters

An address that contains parameters (`?…`) isn't cached, unless all of its parameters are listed in `conf/cache-query-params.user.conf`: those are ignored. By default: `utm_*`, `fb_*`, `ref` and `t`.

- Add one parameter name per line; a trailing `*` covers all names that start that way.
- Never put a parameter there that changes the page content or identifies a visitor.
- This file is picked up within a few seconds, without a restart.

## Cache duration

The `conf/cache-ttl.user.conf` file sets how long a page stays in cache: `fastcgi_cache_valid 200 302 10h;` by default, i.e. 10 hours. After a change, click **Restart PHP / Nginx**, then **Clear cache**: this change doesn't purge pages already in cache.

## If the restart is refused

**Restart PHP / Nginx** first tests the whole configuration. If there's an error, the restart is cancelled and your site keeps running with the old configuration. The interface then shows "Invalid nginx configuration — restart aborted. Fix the configuration:", followed by the error details returned by nginx. The message stays on screen until you close it: fix the faulty file, starting with the last one you edited.

> ⚠️ **Fix or delete the file right away.** If left in place, it would prevent the site from responding after a **Restart server**.

## Good to know

- WordPress admin pages, login and the REST API are never cached: no need to add them.
- Copy a file's contents before editing it, so you can roll back.
- The AI assistant can tell you the exact rule to write for your case.

👉 [How do I clear the cache?](https://help.faaaster.io/en-us/article/clear-the-cache-1y5ly2e/) · [How do I restart my site?](https://help.faaaster.io/en-us/article/restart-your-site-1tp89sn/) · [How do I add a redirect?](https://help.faaaster.io/en-us/article/add-an-nginx-redirect-ya16rb/)