How to create block rules

Our code is smart enough to recognize some special tokens when analyzing your filter rules. We added this feature to save on the size of our global rules as a whole and to allow you to consume fewer of those "Max custom rules" that are tied to your plan.

What is a smart rule anyway?

A smart rule is one that contains special tokens that are interpreted when checking against your requests. These tokens allow you to target a wider portion of the domains or...a specific case - depending on the situation.

When we created our initial lists of domains to block we noticed that almost half of our rules were actually duplicates. For example and fakenewsimaginary.comare one and the same from a technical standpoint.

The double-pipe token

Targets both the www and non-www part of a domain

 By introducing the "double pipe" token we managed to shape down the global list of 2.5M records to about 1.2M. Translated for our example, || will now target both the www variant and the non-www

This is really important because it directly affects the speed of the response from our servers to our clients. When a request is made, we have to parse our lists and see if the target of the request matches any record. The bigger the list, the longer the computation - basic stuff. We're doing everything we can to keep that list as small, accurate and healthy as possible.

The asterisk token

Targets everything after it

We don't use this token all too often because it is too broad and powerful for us but it has it's usefulness nonetheless. Some popular CDNs and specific websites generate URLs that go way beyond the first subdomain.

By adding an * in front of a domain say * transforms that rule into a match by suffix type. The rule will basically match every target that ends with as the root domain.

That's all for now, I'm sure we will be adding more to the filtering engine so make sure to subscribe to our mailing list or simply check back on our tutorials regularly for updated material.