Skip to content
nsin docs

Cache Rules

A cache rule controls caching for the addresses it covers; whichever rule matches decides how a request is cached.

  1. Rules → Add Rule → Cache Rule.
  2. Set the addresses it applies to (/*, /assets/*, etc.).
  3. Choose what to cache and for how long.
  4. Click Save.
ScopeWhat it caches
Static filesImages, CSS, JS, fonts, downloads. Safe default.
EverythingEvery cacheable response, HTML included.

No “custom” scope — narrow the rule’s paths to cache less.

  • TTL — how long a copy stays fresh before nsin re-fetches.
  • Background refresh — nsin re-fetches on a schedule while still serving the current copy, so visitors never wait.
  • Include query string — on, ?page=1/?page=2 cache separately; off, they share one copy.

On by default so caching can’t leak private data. Turn one off only if the response is identical for everybody.

CheckWhat it does
Skip requests with an Authorization headerDoesn’t cache authenticated requests.
Skip responses that set a cookieA session cookie is personal.
Honour no-store from the visitorRespects a browser’s no-store.
Honour your server’s Cache-ControlServer’s headers decide.
Use your server’s max-ageUses server’s max-age, not the rule’s TTL.
Never cache WordPress admin/loginLeaves /wp-admin and /wp-login.php alone.
If the page…Do this
Same for everyone (blog post, image)Cache it
Differs per person (account, cart)Don’t cache, or keep safety checks on
Changes constantly (live scores)Short TTL, or background refresh

A private page got cached and showed the wrong data. Exclude that path, then purge once. Usual cause: an Everything-scope rule with the cookie check off.

My changes aren’t showing. Purge, or use developer mode.

Which rule applied to a request? Check the Nsn-Cache-Status header — see Proxy Headers.