# Disabling entity tags (ETags)

> Turn off ETag headers with .htaccess or the Apache configuration to avoid caching mismatches, and check the result.

Source: https://helpcenter.ruachost.com/developers/web-servers/disabling-entity-tags-etags/

Entity tags (**ETags**) are HTTP headers used by web servers and browsers to manage caching. On **ruachost.com**, you may want to disable ETags to avoid cache mismatches across clustered servers or during site development.

## Why Disable ETags?

- Prevents inconsistent caching when your site is hosted on multiple servers.
- Ensures browsers don’t serve stale content.
- Useful during development or testing when frequent changes occur.

## Steps to Disable ETags

### Method 1: Using `.htaccess`

Add the following lines to your `.htaccess` file in the `public_html` directory:

```
Header unset ETag
FileETag None
```

- `Header unset ETag` removes the ETag header from responses.
- `FileETag None` disables Apache’s automatic generation of ETags.

### Method 2: Apache Configuration (Unmanaged VPS/Dedicated Servers)

If you manage your own server, you can disable ETags globally in the Apache configuration file (`httpd.conf`):

```

    Header unset ETag
    FileETag None

```

Restart Apache after making changes:

```bash
sudo systemctl restart apache2
```

## Verifying ETags Are Disabled

1. Open your site in a browser.
2. Use **Developer Tools** (Chrome: `F12 → Network tab`).
3. Inspect the response headers.
4. Confirm that no `ETag` header is present.

Alternatively, use command‑line tools:

```bash
curl -I https://yourdomain.com
```

Check the headers for absence of `ETag`.

> **Important Notes:**
- Disabling ETags may slightly reduce caching efficiency, but improves consistency across distributed environments.
- If you later want to re‑enable ETags, simply remove or comment out the `.htaccess` lines.
- Always test changes in a staging environment before applying them to production.
