Title: start preloading via PHP
Last modified: December 12, 2019

---

# start preloading via PHP

 *  [masterr77](https://wordpress.org/support/users/masterr77/)
 * (@masterr77)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/start-preloading-via-php/)
 * Hello,
    I would like to start preloading pages using php.
 * The thing is:
    I have some script running every 2 hours doing something with 
   posts and when it´s done I want that script to call something like “wp super 
   cache start preloading” and it would delete cache and preload it once again. 
   The best would be if I could delete cache and preload it for just some categories
   or posts.
 * Is there any way how to do it, please?
 * Kind Regards, Josef

Viewing 1 replies (of 1 total)

 *  [ontario777](https://wordpress.org/support/users/ontario777/)
 * (@ontario777)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/start-preloading-via-php/#post-12341162)
 * First cache preload does not preload custom post types (if you use it!)
    Than
   better to use external cache preloader as script below setting it on your linux
   server as CRON job:
 *     ```
       #!/bin/bash
       #
       # This script reload all the cache on web
       #
       CACHEDDOMAIN0001="example.com"
       WARMLY_REJECT="gif,jpg,jpeg,png,pdf,txt,xml,ico,svg,css,js,json,eot,woff,woff2,ttf"
   
       cd ~/web/${CACHEDDOMAIN0001}/public_html/
       /usr/local/bin/wp super-cache flush;
       cd ~
   
       #rm -R /home/admin/web/${CACHEDDOMAIN0001}/public_html/wp-content/cache/supercache/${CACHEDDOMAIN0001}/
   
       # ---  what's about --no-cache  parameter???
   
       # Fetching desktop version
       wget --content-disposition --reject-regex "wp-json|wp-includes" --reject=${WARMLY_REJECT} --spider -o wget-${CACHEDDOMAIN0001}.log -e robots=off -r -l 5 -p -S --header="X-Bypass-Cache: 1" ${CACHEDDOMAIN0001}
       # Fetching mobile version
       wget --content-disposition --reject-regex "wp-json|wp-includes" --reject=${WARMLY_REJECT} --spider -o wget-${CACHEDDOMAIN0001}.log -e robots=off -r -l 5 -p -S --header="X-Bypass-Cache: 1" ${CACHEDDOMAIN0001} --user-agent='Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4'
       # Deleting temp wget directory
       rm -R ./${CACHEDDOMAIN0001}
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘start preloading via PHP’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ontario777](https://wordpress.org/support/users/ontario777/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/start-preloading-via-php/#post-12341162)
 * Status: not resolved