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:
- 🔐 Admin pages or private areas (
/admin,/dashboard,/portal) - 🔄 AJAX requests returning JSON or XML
- ⚠️ Pages with empty content or content that has only partially loaded on the client side
- 📊 Specific tracking or measurement tags that should not be modified
- 🧪 CMS previews or sensitive conversion funnels
💡 Real-world examples:
/my-account→ Customer Portal/api/user-data.json→ AJAX request/admin/settings→ back office
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:
- Go to the Settings tab
- In the Targeted Rules panel, click Add Target
- Select the criterion (e.g., request URL)
- Select " Matches a regex"
- Specify the reason for exclusion (e.g.,
^/admin) - Check the “Exclude this target” option
- 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:
- Request URL → the full address (protocol + domain + path + parameters)
- Query path → only the part after the
/(without parameters) - URL in an HTML tag → to target a resource loaded within a tag
<img>,<script>,<link>, or in CSS - Device type → distinguish between desktop, mobile, tablet, legacy browser, or bot
- Client IP address → target or exclude specific IP addresses
- CSS Selectors → Targeting Specific Elements in the DOM Using Their ID, Class, or Complex Selector
💡 You can combine multiple criteria to create a very specific target audience.
The three possible states of a targeted rule
- Enabled → Fasterize's application optimizations are applied to this target
- Disabled → the rule exists but has no effect
- Excluded → All optimizations are disabled for this target
Examples of regular expressions to use
Here are some useful regular expressions for excluding certain pages or resources:
💡 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:
- clearly identify the pages to exclude,
- test your regexes,
- and clearly name your rules.
⚠️ Don't forget to save your changes after adding each rule!
.png)