UPDATE:
After deactivating the plugin and reactivating it again solved the long waiting. However, whenever I click Add New Post button every caches flushed automatically. No posts updated.
Just clicking on Add New Post flushing all the caches. I don’t have any clue why is this happening.
My setting:
<br />
Any help will be great.
-
This reply was modified 4 years, 12 months ago by arindam4u.
-
This reply was modified 4 years, 12 months ago by arindam4u.
Hello @arindam4u
Thank you for your questions. First of all why it took so long time to process the Add New Post and update any post: It has probably little to do with the query that is shown by Query Monitor, since that query is still not very slow. It was probably caused by the fact that you had a lot of ‘overview’ caches for posts. Whenever a post is edited or added all those ‘overview’ caches need to be flushed, since they (might) change. We are going to investigate and try to find a solution to have it not slow down the process this much.
The fact that your caches are flushed when you click Add New Post has to do with the fact that WordPress fires the save_post
hook when that page is loaded. So this is in fact a bug and we should check if indeed a new post has been added so the caches will not get flushed until one has been actually added.
I will let you know once we have implemented a fix for this.
@rockfire Thank you so much for your time and your reply.
I will be waiting for the fix.
@rockfire Can you please tell me how to disable auto flushing cache of default WP REST API for now until you find a fix. Cause it makes things really out of hand.
Hi @arindam4u
I am sorry to hear you are having troubles. This week I am out of the office due to a holiday, so I don’t expect to be able to release a fix this week.
Unfortunately there isn’t a hook or setting you can use to temporary disable auto flushing. What you can do to disable it is edit the file /includes/class-plugin.php
and comment out the lines starting with
add_action( 'save_post', [ $caching, 'save_post' ], 999, 3 );
until the line
add_action( 'comment_post', [ $caching, 'delete_comment_type_related_caches' ], 999, 2 );
So lines 143 – 162, that will disable the auto flushing.
@rockfire Thank you so much! It worked and it will do for now until the problem is solved.
Thanks again.
Hi @arindam4u
This should now be solved in the latest version of our plugin.
Thank you so much for your help and support.
The problem is solved.