How to Bypass Caching (wpDiscuz Comments Section Only)
Numerous websites use various caching plugins (e.g., WP Rocket, Fast Velocity Minify, etc.) and CDNs (e.g., KeyCDN, Cloudflare, etc.) for caching and delivering a faster website.
Unfortunately, the caching of pages using wpDiscuz are creating problems such as comments, article ratings, and votings not displaying until cache is cleared.
How can we fix this? Which wpDiscuz files should be bypassed by these plugins and CDNs - OR - can you provide a "no-cache" filter (i.e., php snippet) that will accomplish the same? The filter approach would be best, if possible.
It makes no sense to bypass cache for the entire page using wpDiscuz.
By the way, your plugin rocks and do appreciate the support both you and your team provide to all of us.
Reference: (these examples do not provide a solution to this GLOBAL issue)
Any updates on this? We would appreciate a cache-busting snippet so we don't have to bypass caching the entire contents of the page using your plugin.
Thank you. We have reached out to SiteGround. Waiting for their reply.
Would be great if you did the same (as a developer).
Also, it would be great if you can provide a cache-busting code as requested above. Gravity Forms developed one for their forms, I'm sure you guys can too.
We are still having issues with WP Rocket and SG Optimizer. Your plugin needs to kill caching from any and all cache plugins.
What are the ideal WP Rocket settings for wpDiscuz? At this time, we can add comments, but we cannot delete them without refreshing cache (manually).
Any udpates? As stated before, please provide the settings required for WP Rocket, SG Optimizer, and Cloudflare.
It would be best if you can provide a cache-busting code (snippet) similar to the one developed by Gravity Forms.
Comments added via your plugin shouldn't be cached at all. No need to penalize the rest of our blog or news pages due to your plugin.
If helpful, we can provide another staging site so you can verify our findings.
Thank you for your transparency and honesty.
Well, good news anyway!
After performing many tests, we have found a solution to this caching issue. The solution applies to wpDiscuz customers that use the Avada Theme and the following caching plugins or clients: WP Rocket, SG Optimizer, and Cloudflare.
We will post the solution (i.e., procedure) on your WordPress plugin forum.
Hopefully, once you verify the procedure, you can "pin" the procedure so others can find it quickly and solve their own comments caching issues. Also, it would be helpful to add it to your knowledgebase.
How to Bypass Caching of wpDiscuz Comments (Procedure)
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)
(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).
(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.