You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `libmaxcache` | Shared C library for device detection, WebP, cookie/QS handling |
1318
1317
1319
-
After installation, the full .htaccess caching subsystem is enabled by default (`MaxCacheHTCache On`) and the `maxcache-htcache-watchd` daemon is automatically started and enabled on boot.
1318
+
After installation, the full .htaccess caching subsystem is enabled by default (`MaxCacheHtaccess On`). Change detection uses per-request `stat()` polling — no separate daemon is required.
1320
1319
1321
1320
### MAx Cache Activation Guide
1322
1321
@@ -1910,89 +1909,83 @@ By default, Apache re-reads and re-parses `.htaccess` files from disk on every r
1910
1909
1911
1910
#### Change detection
1912
1911
1913
-
Full .htaccess caching detects `.htaccess` changes through two mechanisms:
1912
+
Full .htaccess caching detects `.htaccess` changes through per-request `stat()` polling. Each cached entry on the current request path is checked against disk when its per-entry timer expires (controlled by `MaxCacheHtaccessRevalidateInterval`).
| **watchd (real-time)** | Sub-second | When `maxcache-htcache-watchd` service is running |
1918
-
| **Polling (fallback)** | Up to `MaxCacheHTCacheRevalidateInterval` seconds (default 60) | Always active as a safety net |
1916
+
| `0` (default) | Immediate (next request) | Every request `stat()`s each cached directory on its path |
1917
+
| `N` seconds | Up to `N` seconds | Fewer `stat()` syscalls on busy paths, slower change pick-up |
1919
1918
1920
-
When the `maxcache-htcache-watchd` daemon is running, it monitors the filesystem and signals Apache through shared memory whenever a `.htaccess` file is created, modified, or deleted.
1921
-
1922
-
:::warning CloudLinux 7/8 limitations
1923
-
On CloudLinux 7 and 8, the kernel's `fanotify` interface only supports file write events. This means the watchd daemon detects `.htaccess` **modifications** instantly, but **deletes**, **renames**, and **moves** are not detected in real time — they rely on the polling fallback (`MaxCacheHTCacheRevalidateInterval`, default 60 seconds). If you need faster detection of these operations on CL7/CL8, lower the revalidation interval (e.g. `MaxCacheHTCacheRevalidateInterval 10`).
1924
-
1925
-
On CloudLinux 9+ (kernel 5.14+), all change types — including deletes, renames, and moves — are detected in real time.
1926
-
:::
1919
+
With the default value of `0`, any `.htaccess` create, modify, or delete is detected on the very next request through that directory — no separate daemon is required.
1927
1920
1928
1921
#### Configuration directives
1929
1922
1930
-
All full .htaccess caching directives go inside `<IfModule mod_maxcache.c>` in the Apache configuration. Full .htaccess caching is configured in `/etc/apache2/conf.d/maxcache_htcache.conf`.
1923
+
All full .htaccess caching directives go inside `<IfModule mod_maxcache.c>` in the Apache configuration. Full .htaccess caching is configured in `/etc/apache2/conf.d/maxcache_htaccess.conf`.
1931
1924
1932
-
#### MaxCacheHTCache
1925
+
#### MaxCacheHtaccess
1933
1926
1934
-
* **Syntax**: `MaxCacheHTCache On|Off`
1927
+
* **Syntax**: `MaxCacheHtaccess On|Off`
1935
1928
* **Default**: On (in shipped config)
1936
1929
* **Context**: server config, virtual host
1937
1930
* **Description**: Master enable/disable switch for the full .htaccess caching subsystem.
* **Description**: Polling interval for `mtime` checks when the watchd daemon is not running or for event types not detected by `fanotify` on the current platform. Lower values mean faster detection of changes via polling; higher values reduce `stat()` syscalls.
1938
+
* **Description**: Minimum seconds between `mtime` revalidation checks per cached entry on the request path. With the default of `0`, each entry is `stat()`'d on every request through that path for immediate change detection. Larger values reduce `stat()` syscall traffic on busy paths at the cost of slower pick-up of `.htaccess` edits.
1946
1939
1947
-
#### MaxCacheHTCacheEntries
1940
+
#### MaxCacheHtaccessEntries
1948
1941
1949
-
* **Syntax**: `MaxCacheHTCacheEntries <count>`
1942
+
* **Syntax**: `MaxCacheHtaccessEntries <count>`
1950
1943
* **Default**: 50000
1951
1944
* **Range**: 10–500000
1952
1945
* **Context**: server config, virtual host
1953
1946
* **Description**: Maximum number of cached `.htaccess` entries in shared memory. When this limit is reached, new directories fall back to Apache's standard processing.
1954
1947
1955
-
#### MaxCacheHTCacheMemorySize
1948
+
#### MaxCacheHtaccessMemorySize
1956
1949
1957
-
* **Syntax**: `MaxCacheHTCacheMemorySize <MB>`
1958
-
* **Default**: auto (derived from `MaxCacheHTCacheEntries`)
1950
+
* **Syntax**: `MaxCacheHtaccessMemorySize <MB>`
1951
+
* **Default**: auto (derived from `MaxCacheHtaccessEntries`)
1959
1952
* **Range**: 1–4096
1960
1953
* **Context**: server config, virtual host
1961
-
* **Description**: Shared memory arena size in megabytes. Normally sized automatically — only set this if you see `htcache: arena memory exhausted` in the error log.
1954
+
* **Description**: Shared memory arena size in megabytes. Normally sized automatically — only set this if you see `maxcache-htaccess: arena memory exhausted` in the error log.
* **Description**: Exclude directory trees from full .htaccess caching. The path is matched as a prefix.
1969
1962
* **Example**:
1970
1963
```
1971
-
MaxCacheHTCacheExclude /home/staging /tmp
1964
+
MaxCacheHtaccessExclude /home/staging /tmp
1972
1965
```
1973
1966
1974
-
#### MaxCacheHTCacheMaxFileSize
1967
+
#### MaxCacheHtaccessMaxFileSize
1975
1968
1976
-
* **Syntax**: `MaxCacheHTCacheMaxFileSize <KB>`
1969
+
* **Syntax**: `MaxCacheHtaccessMaxFileSize <KB>`
1977
1970
* **Default**: 256
1978
1971
* **Range**: 0–10240
1979
1972
* **Context**: server config, virtual host
1980
1973
* **Description**: Maximum `.htaccess` file size (in KB) that full .htaccess caching will process. Files exceeding this limit are skipped and served via Apache's standard processing. Set to `0` for unlimited.
* **Description**: Maximum cached entries under a single document root. Prevents one user from monopolizing the shared cache on multi-tenant servers. Set to `0` for unlimited (the global `MaxCacheHTCacheEntries` limit still applies).
1981
+
* **Description**: Maximum cached entries under a single document root. Prevents one user from monopolizing the shared cache on multi-tenant servers. Set to `0` for unlimited (the global `MaxCacheHtaccessEntries` limit still applies).
1989
1982
1990
1983
#### Configuration examples
1991
1984
1992
1985
##### Minimal setup
1993
1986
1994
1987
```
1995
-
MaxCacheHTCache On
1988
+
MaxCacheHtaccess On
1996
1989
```
1997
1990
1998
1991
Enables full .htaccess caching globally with default settings (50,000 max entries, 60-second revalidation).
@@ -2003,8 +1996,8 @@ For a server with ~5,000 WordPress sites:
2003
1996
2004
1997
```
2005
1998
<IfModulemod_maxcache.c>
2006
-
MaxCacheHTCache On
2007
-
MaxCacheHTCacheEntries 100000
1999
+
MaxCacheHtaccess On
2000
+
MaxCacheHtaccessEntries 100000
2008
2001
</IfModule>
2009
2002
```
2010
2003
@@ -2015,9 +2008,9 @@ For a server with ~5,000 WordPress sites:
| Log: `htcache: entry limit reached (50000/50000), skipping /path` | Cache is full — increase `MaxCacheHTCacheEntries` | Remaining directories use standard Apache processing |
2109
-
| Log: `htcache: per-docroot entry limit reached (256/256) for /home/user` | Single user filled their quota — increase `MaxCacheHTCacheMaxEntriesPerDocroot` | Other users are not affected |
2110
-
| Log: `htcache: arena memory exhausted (400MB/400MB)` | Shared memory arena is full — increase `MaxCacheHTCacheMemorySize` | Restart Apache after changing |
| Log: `maxcache-htaccess: entry limit reached (50000/50000), skipping /path` | Cache is full — increase `MaxCacheHtaccessEntries` | Remaining directories use standard Apache processing |
2100
+
| Log: `maxcache-htaccess: per-docroot entry limit reached (256/256) for /home/user` | Single user filled their quota — increase `MaxCacheHtaccessMaxEntriesPerDocroot` | Other users are not affected |
2101
+
| Log: `maxcache-htaccess: arena memory exhausted (400MB/400MB)` | Shared memory arena is full — increase `MaxCacheHtaccessMemorySize` | Restart Apache after changing |
2111
2102
2112
2103
If changes must take effect immediately, restart Apache: `systemctl restart httpd`.
0 commit comments