Artica Wiki

Advanced caching

Give each website its own on-disk cache with per-URL rules: exclude what must never be cached, cache static assets harder, and keep the site online when the backend fails.

Advanced caching (also called Expert mode) gives each website its own dedicated on-disk cache inside the reverse-proxy, driven by your own rules.

Instead of a single global on/off switch, you decide how long content stays cached, which parts of the site must never be cached (administration areas, APIs, shopping carts), and which files should be cached harder by the visitor browser (images, style sheets, scripts).

Pages served from the cache are returned by the reverse-proxy itself: your backend server is never contacted, so the response is faster and the backend load drops.

Benefits

Use cases

Situation Recommended configuration
CMS / blog / institutional website (WordPress, Drupal, Joomla) Time to live of 10 minutes to 1 hour. Exclude the administration area (/wp-admin, /administrator, /user) and the login page. Over-cache .jpg, .png, .css, .js for 12 to 24 hours.
E-commerce Exclude everything personalised: /cart, /checkout, /account, /api. Over-cache product photographs and the front-end bundle. Keep the general time to live short so price and stock changes appear quickly.
Single-page application with a REST backend Exclude /api (path mode) so data calls always reach the backend, and over-cache the static bundle (.js, .css, fonts, images) for 24 hours.
Documentation, marketing or landing pages Content changes rarely: a time to live of several hours is safe and removes almost all backend traffic.
Slow, fragile or overloaded backend Enable the cache with Serve stale content on backend error. Even a short time to live absorbs traffic spikes, and the stale copy keeps the site reachable during backend outages.
Site distributing large files Exclude the heavy extensions (.iso, .zip, .tar.gz) in extension mode so a few huge downloads do not evict all your cached pages.
Site behind an unreliable network link A longer time to live plus stale-on-error dramatically reduces how often the link is used.

Opening the Advanced caching panel

Open Web services, select the website you want to tune, select Optimization and click on  Caching — Expert mode panel. 

The panel is organised in three tabs: the general settings, the exclusions, and the over-cache rules.

1. General parameters

Advanced caching - general parameters

This tab controls the cache zone itself.

Setting Default Description
Enable the feature Disabled Turns advanced caching on for this website. While it is disabled the rules of the two other tabs are stored but have no effect.
Time to live 1 hour How long a cached response stays valid before the reverse-proxy asks the backend for a fresh copy. Choose a value and its unit (seconds, minutes, hours, days). Error responses (404) are cached for 1 minute only, so a temporary mistake never sticks for hours.
Maximum cache size 1 GB Disk budget for this website. When the limit is reached the least recently used entries are removed automatically.
Inactive time before purge 2 hours An entry that is not requested during this period is deleted, even if its time to live has not expired. This keeps the cache filled with content people actually ask for.
Serve stale content on backend error Enabled If the backend is unreachable, times out, or answers 500/502/503/504, the last cached copy is served instead of an error page. This is the setting that keeps your site online during a backend outage.
Caches directory / Working directory — Read-only. Where this website stores its cache on disk.

Click the edit icon on the Time to live row to set the value and its unit:

Advanced caching - time to live

How long a cached response stays valid before the reverse-proxy asks the backend for a fresh copy

2. Exclusions — content that must never be cached

Advanced caching - exclusions

A request matching any enabled exclusion rule is never served from the cache and is never stored in it:  it always reaches the backend. 

Use this tab for everything that is personalised, authenticated or sensitive.

Advanced caching - new exclusion rule

FieldDescription
Mode
  • Path — matches the beginning of the URL. /admin also covers /admin/users. Letter case is ignored, so /Admin is caught too.
  • Extension — matches the end of the URL. .iso matches every URL ending with that extension, whatever the case.
  • Regex — a regular expression evaluated against the URL, for the cases the two other modes cannot express, for example ^/(admin|api)/v[0-9]+/.
PatternThe value to match, according to the selected mode.
CommentFree text, shown under the pattern in the table. Use it to explain why the rule exists.
EnabledA disabled rule is kept but ignored. Handy to test the impact of a rule without deleting it.

In the table, click the Enabled label to switch a rule on or off, click the pattern to edit it, and use the red icon to delete it.

3. Over-cache — caching harder

Advanced caching - over-cache rules

tell the visitor browser to keep them for a long time.

Over-cache rules target files that almost never change — images, style sheets, scripts, fonts. 
The browser then stops requesting them altogether, which removes traffic both from the reverse-proxy and from your backend.

The form is the same as for exclusions, with one extra field: the time to live in minutes applied to the matching files.

Advanced caching - new over-cache rule

Rules are evaluated in creation order and the first one that matches a URL wins.

What over-cache does exactly. A matching request gets its Cache-Control header rewritten to public, max-age=<your TTL> before the response is sent to the visitor, so the browser keeps the file for that duration.

On the server side the response is still stored according to the general Time to live of the site and to the cache headers returned by your backend: a response that the backend marks as no-store, private, or that sets a cookie, is not stored by the reverse-proxy. Over-cache never overrides that decision.

What is never cached

Independently of your rules, the reverse-proxy refuses to serve or store a cached response in the following cases. These guards exist to protect personalised content:

Important. Cached content is shared between all visitors of the website. Session cookies and the Authorization header are handled automatically, but an application that personalises a page using another mechanism — a custom header, a query parameter, the client IP address — must have those URLs added to the Exclusions tab. When in doubt, exclude first and measure afterwards.

Testing and troubleshooting

Good to know