Skip to main content

Adjusting the Delay Between Preloading Pages

Updated over 3 weeks ago

FlyingPress preloads pages into the cache with a short delay between each request to avoid overloading the server. By default, this delay is 0.2 seconds.

You can change this delay using the flying_press_preload_delay filter.

Where to add this code

Add the snippet to:

  • Your theme’s functions.php file

  • A custom plugin

  • A plugin like Code Snippets

Usage

Increase the delay to reduce CPU or resource usage

Useful on shared hosting or limited-resource environments.

add_filter('flying_press_preload_delay', function () {
return 1; // 1 second delay
});

Decrease the delay to speed up preloading

Recommended on dedicated or high-performance servers.

add_filter('flying_press_preload_delay', function () {
return 0; // No delay between requests
});

Use decimals for fine-tuned control

You can also use decimal values like:

add_filter('flying_press_preload_delay', function () {
return 0.5; // 0.5 seconds between requests
});
Did this answer your question?