Back to articles

How can I exclude certain pages from optimization using targeted rules?

Some pages on your site should not be optimized by Fasterize. This includes, for example, admin pages, AJAX requests, and certain sensitive internal scripts. To do this, you can use targeted exclusion rules. This feature allows you to disable all optimizations on one or more pages based on very specific criteria.

Introduction

Some pages on your site should not be optimized by Fasterize. This includes, for example, admin pages, AJAX requests, and certain sensitive internal scripts.

To do this, you can use targeted exclusion rules. This feature allows you to disable all optimizations on one or more pages based on very specific criteria.

Let's go through the steps one by one.

When should a page be excluded from optimization?

Here are some common situations in which it is recommended to exclude a page or resource:

💡 Real-world examples:

Exclude a page using a targeted rule

Fasterize lets you set up a custom rule to exclude one or more pages from optimization.

Steps to follow:

  1. Go to the Settings tab
  2. In the Targeted Rules panel, click Add Target
  3. Select the criterion (e.g., request URL)
  4. Select " Matches a regex"
  5. Specify the reason for exclusion (e.g., ^/admin)
  6. Check the “Exclude this target” option
  7. Click Save

💡 Once excluded, no Fasterize optimizations will be applied to this page.

Types of exclusions available in Fasterize

Targeted rules offer a high degree of flexibility: you can apply specific settings or exclude a target entirely.

You can set up your rules by combining several criteria, such as:

💡 You can combine multiple criteria to create a very specific target audience.

The three possible states of a targeted rule

Examples of regular expressions to use

Here are some useful regular expressions for excluding certain pages or resources:

Objective Regular expression
Home Page ^\/$
Admin pages \/admin
AJAX Calls Using JSON \.json$
Dashboard pages \/dashboard
All API URLs ^\/api\/.*

💡 For more information on regular expressions, visit regex101.com.

Conclusion

With targeted exclusion rules, you retain full control over the optimizations applied by Fasterize.

It is a simple, powerful, and essential tool for ensuring that the critical areas of your site continue to function properly.

Take the time to:

⚠️ Don't forget to save your changes after adding each rule!