How to Bypass Caching of wpDiscuz Comments (Procedure)
Dear Community,
If you're having issues with comments not showing up on your Blog or News page(s) due to caching plugins, worry no more.
We have developed a workaround (i.e., procedure) that will allow you to cache your Blog or News pages minus the comments section of affected pages. The procedure (provided below) applies to those using the following host, theme, plugins, and CDN:
- SiteGround (Host)
- Avada (Theme)
- SG Optimizer (Caching Plugin)
- WP Rocket (Caching Plugin)
- Cloudflare (CDN)
Procedure:
(1) SiteGround: No special code or set-up needed.
(2) Avada: No special code or set-up needed.
(3) SG Optimizer:
(a) Go to WP Dashboard > SG Optimizer > SuperCacher Settings > Excluding URLs (Details: http://prntscr.com/vg4uj5)
(b) Add the URL sub-domain defined for the individual posts in your website. It is imperative that you use the proper wildcard (*) and slashes (/) for your affected posts (pages). For example, if your individual blog URLs (permalinks) have the format https://www.mywebsite.com/blog/mywebsiteblogpost/, then use the following exclusion URL format: https://www.mywebsite/blog/*/
(4) WP Rocket:
(a) Go to WP Dashboard > Settings > WP Rocket > Advanced Rules > Always Purge URL(s) (Details: http://prntscr.com/vg5amv)
(b) Add the same URL(s) you added to SG Optimizer as noted in Step (3)(b) above. Please Note: WP Rocket uses a different wildcard format. Also, there is no need to exclude your News or Blog URL(s) in WP Rocket. wpOptimizer automatically recognizes WP Rocket (except as noted here).
(5) Cloudflare:
(a) Go to Cloudflare > Dashboard > Page Rules > Create Page Rule (Details: http://prntscr.com/vg5owg)
(b) Set up a Page Rule for your affected Blog and/or News pages using the same URL(s) you added to SG Optimizer in Step (3)(b) with the following Cloudflare Page Rule settings: (Details: http://prntscr.com/vg61jt)
Always Online: On
Security Level: Medium
Cache Level: Standard
(Important: Do not use "Cache Everything" for the affected URL(s). Otherwise, this entire procedure will not work)
(6) Purge all cache in the following sequence (wait one minute after clearing cache for each item): Theme, WP Rocket, SG Optimizer, Cloudflare, Browser
(7) Go back to your affected Blog or News post, enter a test comment, and verify the above works.
We welcome any comments or recommendations that will help improve the above procedure.
Cheers!