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

Domain Manager: Pattern‑Based Cache Expiration

Instead of running a one‑size‑fits‑all cache schedule, create discrete rules that target specific URL patterns and assign unique recache intervals. It’s like giving every part of your site its own mini marketing plan.

What Is Pattern‑Based Cache Expiration?

Traditionally, cache expiration is the time we wait before recaching a page. Shorter durations keep content fresh, while longer durations conserve resources. With pattern‑based rules, you segment your site by URL and set individual expiration times. This aligns cache freshness with business priorities—no more over‑caching your evergreen content while under‑caching your breaking news.

How to Create a Rule

Step 1: Navigate to Domain Manager

  1. Log into your dashboard and open Domain Manager.

  2. Select your target domain. (Eye Icon)

  3. Scroll to Scheduler Settings.

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

 

Step 2: Define Your URL Pattern

In the Rule field, enter the URL pattern you want to match. You have two strategic options:

Option 1: Simple Substring Match

Enter any substring that appears in the URLs you want to capture. This option piggybacks on Prerender’s ability to match URLs by a “contains” rule.

Examples:

  • /products/ — matches any URL containing /products/

  • /blog/2024/ — matches all posts from 2024

  • ?category=electronics — matches URLs with that query parameter

Option 2: Wildcard Pattern

Use the asterisk * as a wildcard to match any characters in the path. Wildcards provide flexible pattern‑matching across domains and paths.

Examples:

  • /blog/*/comments — matches all comment pages under blog posts

  • /products/*/reviews — matches all product review pages

     

Wildcard 101: The * character matches any sequence (including none) and is converted to a regular expression. If you want to match anywhere in the URL, start your pattern with a *

Step 3: Set Cache Expiration

Use the slider to select how frequently the matched URLs should be recached. Plans typically allow you to set values from 6 hours to 30 days. Shorter durations boost freshness for rapidly changing content; longer durations optimize resource usage. Slide left for shorter intervals and right for longer ones.

Step 4: Review and Save

Before you hit OK button, let’s make sure everything checks out.

  • Heads-up: This change may increase/decrease your monthly render counter.

  • When you click OK, the backend springs into action:

    1. Counts how many URLs match your new pattern.

    2. Validates that your rule doesn’t affect more than 50 % of your domain’s URLs.

    3. Cross-checks your plan’s limits and existing rules.

  • If the validation passes, the rule is saved.

  • If the validation fails, you’ll see an error message such as:

    • "Setting affects more than 50% of urls". 

    • "Max rules per domain is already reached"

    • "Setting with the same rule already exists"

     

Understanding the Scheduler Settings Table

After adding rules, you’ll see them listed in a table. The columns provide at‑a‑glance insights:

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

Technical Details

Pattern Matching Logic

Rules with wildcards are converted to regular expression, where * becomes .*. Rules without wildcards use SQL LIKE with % wildcards on both sides. For example, /products/ becomes %/products/%.

 

Validation Rules

  • Maximum URL Percentage: A rule cannot affect more than 50 % of your domain’s cached URLs. If your pattern matches too many URLs, refine it until the count drops below half.

  • Maximum Rules per Domain: Your plan determines how many rules you can create—free plans don’t include this feature, standard plans allow a few rules, and premium plans offer more flexibility.

  • No Duplicate Rules: You can’t create duplicate patterns for the same domain.

Use Cases and Best Practices

Use Case 1: Frequent Updates for News/Blog

Your blog posts are updated constantly, while the rest of your site is static. Create a rule like https://example.com/blog/* and set it to recache every 12 hours. This keeps the newsroom fresh without hogging resources.

Use Case 2: Product Inventory

Product pages need frequent price updates, but category pages change less often. Use a simple substring match like /products/ and set an expiration of 6 hours. Your inventory stays current and your render count stays on budget.

Use Case 3: Seasonal Content

Holiday promotions need rapid refresh cycles. Create a rule like /holiday-sale-2024/ with a short interval (e.g., 2 hours). After the season ends, delete the rule to go back to normal.

Best Practices

  1. Start Specific: Begin with narrow patterns, then broaden them if necessary.

  2. Monitor Impact: Check the Number of Pages column to ensure your pattern captures only the intended URLs.

  3. Watch Your Render Budget: Shorter cache durations can increase your monthly renders

  4. Test Your Pattern: Use a regex tester to confirm wildcard patterns match the URLs you expect

  5. Don’t Over‑Segment: Too many rules can become hard to manage—group similar content when possible.

How It Affects Your Cache

Recache Behavior

When a URL matches multiple rules, the most specific pattern takes precedence. If no pattern matches, the default cache expiration applies. Pattern‑based rules offer granular overrides for the global setting.

Render Counter Impact

Shorter recache intervals lead to more renders. For example, if 100 URLs are matched and you set an expiration of 12 hours, that means two recaches per day, or about 6,000 additional renders in a 30‑day month. Align expiration with your usage plan to avoid surprises.

.

Troubleshooting

“Setting affects more than 50 % of URLs”

Your pattern is too broad. Make it more specific or break it into multiple rules.

Pattern Not Matching Expected URLs

Verify the Number of Pages count and ensure wildcards match the full URL. Patterns are case‑sensitive, so double‑check capitalization.

“Add Rule” Button Disabled

You’ve reached the rule limit for your plan or you lack the necessary permissions. Upgrade your plan or contact support.

Permissions

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

Related Features

Was this article helpful?