30+
May 31, 2019
May 31, 2019
CloudFlare is a popular CDN service. They caches static files like .jpg, .css or .html, but they doesn’t cache dynamic pages generated by WordPress without Page Rule.
Once Page Rules are set, for exmple, https://examle.com/article/*, every single page will be cached(of course, your permalink structure should be like https://example.com/article/2019/01/01/POST_ID).
This plugin hamecache provides cache control feature. If you update your article, hamecache automatically flush related caches on cloudflare edge location.
hamecache directory to the /wp-content/plugins/ directory.We host our sources on GitHub, so please feel free to send PR or to make issues.
You can use hamecache_urls_to_be_purged filter hook for them.
add_filter( 'hamecache_urls_to_be_purged', function( $urls, $post ) {
// Add your custom URL.
$urls[] = your_custom_link( $post );
return $urls;
}, 10, 2 );