رفتن به محتوا

Cache Rules

این محتوا هنوز به زبان شما در دسترس نیست.

A cache rule lets you change how caching works for certain pages. Most of the time nsin’s default caching is great, but sometimes you want extra control — for example, to never cache a private page, or to cache something for longer.

  • A page shows personal or live data and should never be cached (like a cart or account page).
  • A file rarely changes and you want nsin to keep it cached for a long time.
  • You want to bypass the cache for a section of your site while you test changes.
  1. Go to RulesAdd RuleCache Rule.
  2. Set the When (which addresses it applies to). For example:
    • /account to match your account pages.
  3. Choose the caching behavior:
    • Bypass cache — never store a copy; always ask your server.
    • Cache — store a copy (you can set how long to keep it).
  4. Save.
If the page…Do this
Shows the same thing to everyone (a blog post, an image)Cache it
Shows different things per person (account, cart, dashboard)Bypass the cache
Changes very often (live scores, stock)Bypass or use a short cache time

By default, nsin uses its own smart caching and ignores the cache instructions your server sends. If you know what you’re doing and want nsin to follow your server’s cache instructions instead, you can turn on the “respect origin headers” option for the rule. Leave it off if you’re not sure — the default works well for most sites.

My private page got cached and showed the wrong data. Add a cache rule that bypasses the cache for that page, then purge the cache once.

I want a file to load instantly forever. Add a cache rule that caches it for a long time. If you later change that file, remember to purge it.