How can I reduce the number of cache cleanups after posting news and comments?
-
Hello, dear developers!
I am faced with such a problem. When users add a comment or vote for a comment, the cache of all articles is cleared. I have a news site and the speed of access to articles and news is important. It becomes expensive to re-cache at least 200 recent articles and news 100 times a day.Because of this, many users encounter pages that have not yet been added to the new cache and the page loading speed increases to 5-7 seconds. Clearing the entire cache after posting a news item or adding a comment and voting for a comment seems pointless to me.
I will be glad if you can tell me:
1. How can I make sure that after posting a comment and voting for a comment, the cache is cleared only in this particular news, and not throughout the site? Or in general, how do I remove the comment block from the page caching?2. How do I not reset the entire cache when adding a new article? On the “Cache” > “Cleanup” page, only “Home page” and “Archives” have been added to the cleanup rules https://skr.sh/sS0vJfOxRiB , but when adding an article, the cache with all articles is cleared anyway.
3. I use the wpDiscuz 7 comment plugin, they have a function to “Hide the comment text” https://prnt.sc/g2u8Ld-z-UWf The text of the comments appears on the page and in the page code only after clicking on the “View comments” button. But even with this feature enabled, after posting one comment, the cache is cleared for all site pages. Is this logical?
I ask for help on these three points from both developers and experienced users of the LSCache plugin.The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.