Added a new filter named rt_nginx_helper_preload_urls which contains an array of URLs. Those URLs will be preloaded through the shutdown hook.
Get the current updated post from the transition_post_status hook and check whether the post status is published from a non-published status. Then the URL of the post will be added to the rt_nginx_helper_preload_urls filter so that the URL can be preloaded.
With the above process, a new post will be cached as soon as they got published. Also, the rt_nginx_helper_preload_urls filter can also be used to preload other URLs if needed in the future.
Added a new filter named
rt_nginx_helper_preload_urls
which contains an array of URLs. Those URLs will be preloaded through theshutdown
hook.Get the current updated post from the
transition_post_status
hook and check whether the post status is published from a non-published status. Then the URL of the post will be added to thert_nginx_helper_preload_urls
filter so that the URL can be preloaded.With the above process, a new post will be cached as soon as they got published. Also, the
rt_nginx_helper_preload_urls
filter can also be used to preload other URLs if needed in the future.