Speed
Let the WAF agent shrink, serve and remember responses so that fewer requests reach your application. Speed has three parts: compression, files served from a folder, and a response cache. Each part has its own switch and is off by default. The WAF checks every request first, so a blocked request never gets a cached copy or a file.
- Request that passes
- Request blocked
What it provides
- Compression with gzip or brotli, chosen from what the visitor’s browser asks for.
- Files served from one folder by the agent, for GET and HEAD requests, without asking the application. A request for a file that is not in the folder goes to the application, or gets a 404 if you choose the folder as the whole site.
- A response cache with a memory tier and a disk tier, and path rules that set how long answers are kept.
- Purge of stored copies for one URL, for every path under a prefix, or for the whole application.
- Signed-in visitors skip the cache, and every answer for a path the cache looks up carries an X-Cache header (HIT, STALE, MISS or BYPASS).
How to use it
- Open the Speed tab of the application. Each part has its own switch and Save button.
- Turn on one part at a time. Set the folder for files, the lifetimes and paths for the cache, and list the session cookie name if the application uses an unusual one.
- Check the status line and the counters, look at the X-Cache header on a few pages, and purge copies when the content changes.
- Order of the steps
Configuration and operation
The three parts are on the Speed tab of the application page, each with its own switch, Save button, status line and counters. The agent applies the settings itself and may refuse them, for example when a folder is not allowed or the cache would not fit on disk. It then keeps the settings it already runs. The cache keeps its copies in /var/cache/wafio-waf.
Limits
Only requests that the WAF allows are looked up. The cache never stores answers that set a cookie or say private, no-store or no-cache. A visitor counts as signed in when the request carries an Authorization header or a session cookie. An application with a session cookie name the agent does not know must list it, so that those visitors skip the cache. In the worst case, where every request is for a new URL, storing an answer costs about 2.4 to 3 times the agent CPU of plain forwarding.