• Resolved Hadis

    (@hadis89)


    Hi,

    is it possible to call preload function from standalone php file? I have following script, but it only works from browser where user is logged in to wordpress:

    define( 'WP_USE_THEMES', false );
    include_once 'wp-load.php';
    
    
    WP_Optimize_Page_Cache_Preloader::instance()->run('manual');
    

    If it called from cronjob (this is what I want) it just preload 20 – 25 pages and stops.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Venkat Raj

    (@webulous)

    @hadis89
    1. Since this is privileged task, only logged in users can run preload.
    2. This is long running task for huge sites. So, it creates sub tasks for each URL and schedule it to run via cron job (WP Cron). At max_execution_time it is possible that it loaded ~25 pages and stops (but creates cron job to run later, to avoid max. load on server at one stretch)
    3. process_tasks_queue method will run on wpo_page_cache_preload_continue hook

    Thread Starter Hadis

    (@hadis89)

    Thanks for ansswer

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Preload function from standalone php’ is closed to new replies.