Page Rules migration guide·续1

Page Rules configuration Migrate to a configuration rule
Example Page Rule with 'Browser Integrity Check' setting Configuration rule matching the 'Browser Integrity Check' setting of the example Page Rule

Context:

You configured a Page Rule turning on Bypass Cache on Cookie for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Bypass Cache on Cookie
  • Enter value: test_cookie

How to migrate:

  1. Create a cache rule to bypass cache for requests containing cookie test_cookie for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com" AND Cookie contains "test-cookie"
    • Using the Expression Editor:
      (http.host contains "example.com" and http.cookie contains "test-cookie")
  3. Then:
    • Cache eligibility: Bypass cache

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with 'Bypass Cache on Cookie' setting Cache rule matching the 'Bypass Cache on Cookie' setting of the example Page Rule

Migrate Cache By Device Type

Context:

You configured a Page Rule turning on Cache By Device Type for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Cache By Device Type
  • Value: On

How to migrate:

  1. Create a cache rule to cache content based on user agent or device type for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then:
    • Cache eligibility: Eligible for cache
    • Setting: Cache key
    • Cache by device type: On

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with 'Cache By Device Type' setting Cache rule matching the 'Cache By Device Type' setting of the example Page Rule

Migrate Cache Deception Armor

Context:

You configured a Page Rule turning on Cache Deception Armor for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Cache Deception Armor

How to migrate:

  1. Create a cache rule to protect against cache deception attacks for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then:
    • Cache eligibility: Eligible for cache
    • Setting: Cache key
    • Cache deception armor: On

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with 'Cache Deception Armor' setting Cache rule matching the 'Cache Deception Armor' setting of the example Page Rule

Migrate Cache Level (Cache Everything)

Context:

You configured a Page Rule turning on caching of all assets for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Cache Level
  • Select Cache Level: Cache Everything

How to migrate:

  1. Create a cache rule to adjust cache level for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then:
    • Cache eligibility: Eligible for cache

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with 'Cache Level' set to 'Cache Everything' Cache rule matching the 'Cache Level: Cache Everything' setting of the example Page Rule

Context:

You configured a Page Rule turning on caching for responses that contained cookie test-cookie for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Cache on Cookie
  • Enter value: test-cookie

How to migrate:

  1. Create a cache rule to cache responses containing cookie test_cookie for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com" AND Cookie contains "test-cookie"
    • Using the Expression Editor:
      (http.host contains "example.com" and http.cookie contains "test-cookie")
  3. Then:
    • Cache eligibility: Eligible for cache

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with 'Cache on Cookie' setting Cache rule matching the 'Cache on Cookie' setting of the example Page Rule

Migrate Cache TTL by status code

Context:

You configured a Page Rule turning on caching of every response with status code between 200 and 599 for one day, for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Cache TTL by status code
  • Status code or enter range: 200-599
  • Select option: a day

How to migrate:

  1. Create a cache rule to cache responses with status code between 200 and 599 for one day for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
    • Then:
    • Cache eligibility: Eligible for cache
    • Setting: Edge TTL
      • Use cache-control header if present, use default Cloudflare caching behavior if not
      • Status code TTL:
      • Scope: Range
      • From: 200
      • To: 599
      • Duration: 1 day

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with the 'Cache TTL by status code' setting Cache rule matching the 'Cache TTL by status code' setting of the example Page Rule

Migrate Custom Cache Key

Context:

You configured a Page Rule setting a custom cache key for all query string parameters, for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Custom Cache Key
  • Query String: All query string parameters

How to migrate:

  1. Create a cache rule to set a custom cache key for all query string parameters, for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then:
    • Cache eligibility: Eligible for cache
    • Setting: Cache key
    • Query string: All query string parameters

Caution

The default behavior of Cache Rules is different from Page Rules. Refer to Key differences for more information. 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule.

Page Rules configuration Migrate to a cache rule
Example Page Rule with the 'Custom Cache Key' setting Cache rule matching the 'Custom Cache Key' setting of the example Page Rule

Migrate Disable Apps

Context:

You configured a Page Rule turning off Cloudflare Apps (deprecated) for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Disable Apps

How to migrate:

  1. Create a configuration rule to disable Cloudflare Apps (deprecated) for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then the settings are:
    • Setting: Disable Apps
  4. Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
  5. If your tests succeed, delete the existing Page Rule.
Page Rules configuration Migrate to a configuration rule
Example Page Rule with 'Disable Apps' setting Configuration rule matching the 'Disable Apps' setting of the example Page Rule

Replace Disable Performance

Caution

The Disable Performance setting is deprecated. Any Page Rules with this setting will not be migrated.

This Page Rules setting turned off Polish and Rocket Loader. You can still turn on or off relevant Cloudflare features one by one using Configuration Rules.

Context:

You configured a Page Rule with Disable Performance (deprecated) for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Disable Performance

How to replace:

  1. Create a configuration rule to disable Polish and Rocket Loader for any hostname containing example.com:
  2. When incoming requests match: Custom filter expression
    • Using the Expression Builder:
      Hostname contains "example.com"
    • Using the Expression Editor:
      (http.host contains "example.com")
  3. Then the settings are:
    • Polish: Off
    • Rocket Loader: Off
  4. Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
  5. If your tests succeed, delete the existing Page Rule.
Page Rules configuration Migrate to a configuration rule
Example Page Rule with 'Disable Performance' setting Configuration rule partially matching the 'Disable Performance' setting of the example Page Rule

Replace Disable Security

Caution

The Disable Security setting is deprecated. Any Page Rules with this setting will not be migrated.

This Page Rules setting turns off Email Obfuscation, Rate Limiting (previous version), Scrape Shield, URL (Zone) Lockdown, and WAF managed rules (previous version). You can still turn on or off relevant Cloudflare features one by one using Configuration Rules and WAF custom rules.

Context:

You configured a Page Rule with Disable Security (deprecated) for all subdomains of example.com and the example.com domain itself:

  • URL: *example.com/*
  • Setting: Disable Security

This setting turned off a subset of Cloudflare security features: Email Obfuscation, Rate Limiting (previous version), Scrape Shield, URL (Zone) Lockdown, and WAF managed rules (previous version).