• Resolved royalswes10

    (@royalswes10)


    I’m wondering if there is a way to control the speed at which the cache preload feature will run? I’d like the ability to set how many pages per minute will be preloaded, or something to that effect.

    I have hundreds of pages on our site. Some of the custom PHP used to generate our pages is heavy, so when the cache preload is running, it takes our server load up to unhealthy levels. I’d prefer to be able to slow down the rate at which the pages are preloaded.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    You can use the following filter in order to change the delay between pages:

    add_filter( 'wpoptimize_preload_delay', function( $original_delay ) {
        return 500000; // current value (the number is in microseconds, so 1000000 = 1s) 
    } );

    The default value is 500000, which corresponds to 0.5 second.
    I’d suggest replacing it with 1000000 (1 second) to see the impact, or adjusting until you find a compromise.

    Marc.

    Thread Starter royalswes10

    (@royalswes10)

    Perfect, thank you.

    Thread Starter royalswes10

    (@royalswes10)

    Quick clarification. Should this be placed in functions.php file or somewhere else?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Control Preload Speed’ is closed to new replies.