Skip to main content

Cache rules

A cache rule controls how the edge caches the responses for URLs that match its URL operator. It sets a TTL and, optionally, a set of per-URL location features that override your property-level defaults for the matching requests.

Fields

FieldTypeRequiredNotes
namestringYesDisplay name. Max length 200.
patternstringYesThe match value. Max length 500. See match operators.
matchTypeintegerYesEquals=0, Contains=1, StartsWith=2, EndsWith=3, Regex=4.
ttlSecondsintegerYesCache lifetime in seconds. Default 300 (5 minutes), minimum 0.
orderintegerYesLower runs first. See how rules work.
isEnabledbooleanYesToggle without deleting.
descriptionstringNoOptional free-text note.
featuresJsonstring (JSON)NoPer-rule location features. Max length 5000. See Location features.
A TTL of 0 means do not cache

ttlSeconds: 0 effectively bypasses the cache for matching requests — nothing is stored. Use it to force matching URLs (for example, a cart or checkout path) to always go to the origin.

The default rule: Default — cache static assets

Every new property is seeded at creation with one cache rule named Default — cache static assets, so static files are cached sensibly before you configure anything:

AspectValue
MatchRegex on common static-file extensions: \.(css|js|jpg|jpeg|png|gif|webp|svg|ico|woff|woff2|ttf|otf|eot)$
TTL604800 seconds (7 days)
OrderLast — it has a high order value, so every other rule runs first

The rule is a normal cache rule — nothing about it is special or locked:

  • Editable — change the TTL, pattern, or add location features like any rule you created yourself.
  • Deletable — remove it if you want full manual control (for example on an API-only property where nothing should be cached by default).
  • Overridable — because it is ordered last, rules you add yourself and rules created by a CMS preset always take precedence for the URLs they match. Applying a preset therefore effectively supersedes it (presets ship their own static-assets rule with platform-tuned TTLs).
Deleted it and want it back?

Use the Restore defaults action in the property's Rules tab. It re-creates the seeded default rule; your own rules are left untouched.

Example

Cache everything under /static/ for one hour. In the property's Rules tab, click Add cache rule and set:

  • Pattern: /static/Starts with
  • TTL: 3600 (1 hour)

Then expand Location Features (Optional) to fine-tune just these URLs (see below).

Location features

Location features override your property-level defaults for the URLs this rule matches. In the panel they live under a collapsible Location Features (Optional) panel — set only what you want to override.

OptionShapePurpose
bypass_cookiesarray of cookie namesIf any listed cookie is present on the request, the cache is bypassed (for example, a logged-in session cookie).
cache_keyobjectCustomizes what goes into the cache key.
cache_key.include_query_stringbooleanInclude the query string in the cache key.
cache_key.include_headersarray of header namesAdd these request headers to the cache key (for example, Accept-Language).
cache_key.include_cookiesarray of cookie namesAdd these cookies to the cache key.
minificationobjectOverride minification for matching URLs (see note below).
minification.html | css | jsbooleanEnable minification per content type.
Minification is a property-level setting

Turn minification on in General → Minification, where it applies to the whole property. The minification location feature above only exists to override that default for specific URLs — for example, to disable it under /admin/. A rule that sets it wins over the property setting for the URLs it matches.

Minification is conservative: it strips comments and redundant whitespace but never rewrites your code, and JavaScript containing template literals is passed through untouched. It runs only on a cache MISS and the result is cached under its own key variant, so purge the property after changing it.

Bypass the cache for logged-in users

Listing your CMS session cookie (such as wordpress_logged_in) under bypass_cookies keeps anonymous visitors on the fast cached path while logged-in users always see fresh, personalized pages. See the WordPress examples for a full setup.

How automatic session detection treats static assets

Paradarum also detects well-known CMS and framework session cookies automatically (WordPress, WooCommerce, PrestaShop, Drupal, Joomla, Moodle, Laravel, Django, Ghost and Rails) and bypasses the cache for those requests — but only for dynamic content. Static assets (JS, CSS, images, fonts, media and downloads) are cached regardless of cookies, since they are identical for logged-in and anonymous visitors. Generic anonymous-visitor cookies such as PHPSESSID, JSESSIONID or CSRF tokens never trigger a bypass on their own; if your site personalizes pages using one of those, add it explicitly under bypass_cookies.

Next steps