Carry out all such necessary settings<\/div>\n<\/li>\n<\/ol>\n
Now you have the W3 Total Cache plugin ready to carry out an automatic purge of the Cloudflare page cache over the Post Modifications.<\/p>\n
Step-2<\/strong>: Configure Cloudflare 9 Settings:<\/p>\nAim: Configuration of cache such that it does not influence any other section.<\/p>\n
\n\nRetain the Respect Existing Headers; do not override it. It is significant to follow the W3TC Browser cache settings.<\/div>\n<\/li>\n
\nNow, set up the Cloudflare Page rule.<\/div>\n<\/li>\n<\/ol>\n
(The below two are required for the most nuanced performance.)<\/p>\n
The first one is for Login page security, whereas the second is for carrying out a Full page cache when following the origin header.<\/p>\n
Note: Make sure not to use the ‘Edge Cache’ rule within the Cloudflare; else, it will supersede the origin header poorly. Moreover, it may serve internal page to the unidentified visitor.<\/p>\n
The following settings are shown after careful tests on different websites.<\/p>\n
Tip: For skipping Page cache for some URLs, set Cache Level: Standard.<\/p><\/blockquote>\n
Suggested things to carry out after following the present guide:<\/p>\n
\n\nYou might not wish to cache WordPress.com toolbar. So, it is better to conceal it for unidentified visitors.<\/div>\n<\/li>\n<\/ol>\n
add_action('after_setup_theme', 'remove_admin_bar');\r\n\r\n\r\nfunction remove_admin_bar() {\r\n\r\n\r\nif (!current_user_can('administrator') && !is_admin()) {\r\n\r\n\r\n show_admin_bar(false);\r\n\r\n\r\n}\r\n\r\n\r\n}<\/pre>\n\nThe newest version of WordPress can better deal with the commenting. Hence, you can skip this step.<\/li>\n<\/ol>\n\/\/ First comment redirection\r\n\r\n\r\nfunction redirect_first_time_commenters( $url, $comment ) {\r\n\r\n\r\n\/\/ get count of user comment\r\n\r\n\r\n$comment_count = get_comments( array\r\n( 'author_email' => $comment->comment_author_email, 'count' => true ) );\r\n\r\n\r\n\/\/ if this is the user first comment, redirect to the \"Thank You\" Page\r\n\r\n\r\nif ( 1 == $comment_count ) {\r\n\r\n\r\n$url = 'https:\/\/hostingxp.com\/thank-you-for-commenting\/';\r\n\r\n\r\n}\r\n\r\n\r\nreturn $url;\r\n\r\n\r\n}\r\n\r\n\r\nadd_filter( 'comment_post_redirect', 'redirect_first_time_commenters', 10, 2 );<\/pre>\n\n\nRemove Admin Traffic from the Google Analytics console.<\/div>\n<\/li>\n
\nNow configure the ‘BunnyCDN’ for improving the static content HIT cache ratio and maintain a good balance for the performance.<\/div>\n<\/li>\n
\nConceal frontend Login\/Sign up stuff. (You can avoid this method in the present case\/)<\/div>\n<\/li>\n<\/ol>\n
FAQs:<\/h3>\n 1. Can Cloudflare FSD (Full Site Delivery)be used with any other plugin other than W3TC?<\/p>\n
\n\nNot at all recommended for WP Rocket, WP Fastest Cache, WP Super Cache, and many, mostly may lead to cf-cache-status: MISS because of preventive Cache-Control header for that particular document. This is why I do not recommend anything other than W3TC to fulfill this need.<\/div>\n<\/li>\n<\/ul>\n
2. Help! My site is broken while purging cache<\/p>\n
\n\nDiscussed previously How to Fix W3 Total Cache Fatal Error that comes while Purge 14<\/div>\n<\/li>\n<\/ul>\n
3. How do debug things are functioning correctly?<\/p>\n
\n\nThe Chrome Developer tool proves to the best tool for this. You can use its Networking tab to supervise HTTP response.<\/div>\n<\/li>\n<\/ul>\n
4. Is Cloudflare free plan enough?<\/p>\n
\nIn the majority of the cases, it is enough. For WooCommerce or some other cookie support, the need may arise to use its Business plan with a price of $200\/month. If you need the most affordable option, go for ‘Sucuri 3’ WAF which simply offers identical features.<\/li>\n<\/ul>\nSumming-up:<\/h2>\n After carefully following this guide, you can undoubtedly enhance performance. Also, there will be a significant reduction in server load.<\/p>\n
When Cloudflare Cache Everything is used, the problematic things faced are:<\/p>\n
\n\nExcluding cache on the exact time<\/div>\n<\/li>\n
\nManaging Cache-Control header to serve the web page efficiently<\/div>\n<\/li>\n
\nBalancing better HIT ratio<\/div>\n<\/li>\n<\/ul>\n
The aforementioned method is usually reliant on the W3 Total Cache Plugin that comes with below facts:<\/p>\n
\n\nWhen you exclude Cloudflare HTML cache, there will be exclusion of Cloudflare whole cache (CSS, HTML, JS, images) similar to using the “Purge everything” button. Is this good? No.<\/div>\n<\/li>\n
\nHence, I advised making use of the ‘BunnyCDN’ for maintaining a distinct hostname when you want to cache static content of WordPress.<\/div>\n<\/li>\n<\/ul>\n
This method with CDN is excellent for implementing on a news site that requires real-time purge functionality.<\/p>\n
However, several bloggers might not need to update that excessively<\/p>\n
The alternative approach is:<\/h3>\n\n\nMaintain the Cloudflare configuration as well as rest function code as it is.<\/div>\n<\/li>\n
\nPrevent the use of ‘BunnyCDN.’<\/div>\n<\/li>\n
\nMake sure to configure Browser cache for all the static resources across long-term (for example 1 year)<\/div>\n<\/li>\n
\nRefrain from entirely using W3TC<\/div>\n<\/li>\n
\nSet Cache-Control plugin according to the one shown in the following screenshot. Every configuration is just for the Document web page working on HTML. The same is essential for setting up purge rules depending on the TTL. Read the below section to understand more:<\/div>\n<\/li>\n<\/ul>\n
max-age: It refers to browser cache: Since I believe that blog is dynamic, I will not recommend using Browser cache.<\/p>\n
s-max-age: It is controllable according to TTL, so the content will automatically expire, and CDN needs to revalidate and automatically serve a new version.<\/p>\n
How does it function?<\/h3>\n\n\nYour cache is expected to terminate at a specific time.<\/div>\n<\/li>\n
\nIt is always allowed to purge whether you are doing it manually or automatically. Why does it? Begin from 600 seconds TTL. Now gradually increase once you become an experienced one.<\/div>\n<\/li>\n
\nNow, what for the static content? Cache-Control, you need to know that it is variable according to HTTP requests. Hence, we can add an extra Browser Cache header, especially for the resources such as \/wp-content\/ as well as \/wp-includes\/ through a Page rule of Cloudflare. Alternatively, it is not required if you have already done with .htaccess and have used the respect existing header.<\/div>\n<\/li>\n<\/ul>\n
For page rule:<\/h4>\n *example.com\/wp-*<\/p>\n
\n\nMake a rule where browser cache TTL: The time duration you can keep is 14 days or later. Generally, longer is better because it is the static content.<\/div>\n<\/li>\n
\nMake one more rule for Cache Level: Standard (Ensure to stay away from caching everything now.) It is used here since \/wp-* will cover only static resources; it does not work on HTML.<\/div>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"
If you are looking to setup Cloudflare Cache for WordPress then you have landed in the right place. In this article, we will focus on optimizing WordPress with Cloudflare. The following post is focused on how to use Cloudflare for the following: Accelerate WordPress 22 worldwide without modifying your current hosting (for nearly all cases) […]<\/p>\n","protected":false},"author":1,"featured_media":866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"yoast_head":"\n
How to Setup Cloudflare Cache for WordPress - Configure Best Practices<\/title>\n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n