Skip to content
  • There are no suggestions because the search field is empty.

How do I set custom cache expiration rules?

Control how often Prerender.io recaches specific pages by setting domain-level and pattern-based expiration rules.

 

 Custom cache expiration is only available on Pro and Enterprise plans. 

TL;DR

Custom cache expiration lets you define how often Prerender.io recaches your pages at two levels: a domain-wide default and pattern-based rules for specific URL paths. Set a broad expiration for your entire domain, then create rules for sections that need shorter or longer intervals. This feature is available on Pro and Enterprise plans.

How cache expiration rules are evaluated

When Prerender.io evaluates a URL, it checks expiration settings in this order:

  1. Pattern-based rule. If the URL matches a pattern rule, that rule's expiration applies.
  2. Domain-level expiration. If no pattern rule matches, the domain's default expiration applies.
  3. Account-level expiration. If no domain-level setting exists, the account-wide default applies.

The most specific setting always wins.

Domain-level cache expiration

Domain-level expiration sets a default recache interval for all pages under a domain. It applies to any URL that does not match a pattern-based rule.

Use this when:

  • You are onboarding a new site and want a default cache policy before creating pattern rules.
  • Your domain has mostly stable content where a single interval works.

.

 Step 1: Open Domain Manager and select your domain. 

  1. Log into your dashboard and open Domain Manager.

    Domain Manager section in the Prerender.io dashboard sidebar

  2.  Click the view icon (👁️) next to your target domain  Domain list with view icon to open domain settings
  3. Scroll to Scheduler Settings.Scheduler Settings section within Domain Manage

Step 2:  Set your domain-level cache expiration. 

  1. Move the slider to your preferred value (typically 6 hours to 30 days).
     Cache expiration slider for setting domain-level recache interval
  2. Click on Update
    Update button confirming domain-level cache expiration change

 All pages under this domain that do not match a pattern rule will now recache at this interval. 

Pattern-based cache expiration

Pattern-based rules let you set different cache expiration intervals for specific URL paths. This is useful when different sections of your site change at different rates.

Examples:

  • /blog/* with a 12-hour expiration keeps news content fresh.
  • /products/ with a 6-hour expiration keeps pricing accurate.
  • A static /about/ section can use the longer domain-level default.

 

Step 3: create a pattern-based rule.

  1. In Scheduler Settings, click Add Rule. A modal appears.
    Add Rule button in Scheduler Settings for creating pattern-based rules


  2.  In the Rule field, enter the URL pattern you want to match.           

     

  3. Use the slider to set cache expiration for matched URLs
  4. Click Save

  5. Click Add Rule. A modal appears, add your pattern.

Pattern matching options

Substring match. Enter a string that appears in your target URLs. Prerender.io uses a "contains" match.

  • /products/ matches any URL containing /products/.
  • /blog/2024/ matches all posts from 2024.
  • ?category=electronics matches URLs with that query parameter.

Add Rule button in Scheduler Settings for creating pattern-based rules

Wildcard match. Use * to match any sequence of characters.

  • /blog/*/comments matches all comment pages under blog posts.
  • /products/*/reviews matches all product review pages.
  •  

ℹ️ Wildcard patterns are converted to regular expressions internally (* becomes .*). Non-wildcard patterns use a SQL LIKE match with % on both sides (e.g., /products/ matches any URL containing /products/). Pattern matching may be case-sensitive depending on your configuration.

Validation rules

When you save a rule, Prerender.io validates it:

  • 50% cap. A rule cannot affect more than 50% of your domain's cached URLs.
  • Plan limits. Pro plans allow 5 rules per domain. Enterprise plans allow 10.
  • No duplicates. Each pattern must be unique per domain.

If validation fails, you may see messages like:

  • "Setting affects more than 50% of urls"

  Validation error: rule affects more than 50% of domain URLs

  • "Max rules per domain is already reached"Validation error: maximum rules per domain already reached

  • "Setting with the same rule already exists"Validation error: a rule with the same pattern already exists

 

Step 4: review your rules in the Scheduler Settings table.

After adding rules, they appear in a table:

 

Column Description
Rule The URL pattern you defined
Cache Expiration The recache interval selected
Number of Pages How many cached URLs currently match this pattern
Actions Delete the rule when it’s no longer needed

How new rules interact with your existing cache schedule

When you create or update a cache expiration rule, the new setting does not immediately trigger a recache. Each cached page is already following the schedule established by its previous expiration setting.

Cache schedule showing the next recache time for a cached page 

Each page has a next scheduled recache based on the interval that applied when it was last rendered. You can see this schedule in Caching Queue → Automated Queue, where cached pages are listed with their next recache time.

After a page completes its current recache cycle, it begins following the new expiration rule. From that point onward, Prerender.io recalculates future recache timings based on your updated settings.

This means:

  • You may still see URLs recaching according to their original interval until their current cycle completes.
  • The transition happens gradually, not instantly.

Render count impact 

Shorter cache expiration intervals increase your render count. For example, 100 URLs with a 1-day expiration recache twice daily (desktop and mobile), resulting in approximately 6,000 renders per month with mobile rendering enabled. 

ℹ️ Prerender.io renders both a desktop and a mobile version of each page by default. Each version counts as a separate render. If mobile rendering is disabled, the count in the example above drops to approximately 3,000 renders per month.

Role Permissions

 

Role View Rules Create Rules Delete Rules
Owner/Admin
Member
Billing Manager
Guest

Troubleshooting

Issue Cause Solution
“Setting affects more than 50% of URLs” Rule too broad Make it more specific or split it into smaller rules
Pattern not matching expected URLs Case sensitivity or incorrect pattern Verify capitalization and wildcard placement
“Add Rule” button disabled Reached plan limit or missing permissions Upgrade your plan or contact support
 

 Related articles

 


💬 Still need help? If your cache expiration rules are not behaving as expected, our support team can help you diagnose the issue. Contact us at support@prerender.io

 

Was this article helpful?