Cand you plugin be set to preload the front page too ?
Well. Technically, it is possible. But, I’d like to keep the plugin’s functionality to the minimum so that anyone who wants to tweak it can extend it easily, depending on their individual use-case.
When a popular site posts a new blog post and the author shares its link via FB, twitter, etc, people usually rush only to the new blog post and not to the home page (generally). That’s why I kept it to the minimum.
You’d only need to add the following function and then trigger it (like how it’s done for the new blog post). Here’s the basic idea…
function zaone_preload_homepage( $post_ID, $post, $update ) {
$homepage = get_site_url();
// declare $desktop_url_args, $mobile_url_args, and $amp_url_args
wp_remote_get( $homepage, $desktop_url_args );
wp_remote_get( $homepage, $mobile_url_args );
wp_remote_get( $homepage, $amp_url_args );
}
And what timings does it have set to access the post after publishing ?
It happens right after publishing the post.