Hi @macksix,
Do you have object cache on these websites? Or just enabled page cache only?
Moving a post to the trash can take a long time on large WordPress setups. However, 15 seconds still seems unreasonable.
Can you try this snippet and let me know if it makes any difference:
add_filter( 'powered_cache_advanced_cache_purge_urls', function ( $urls, $post_id ) {
$urls = array();
$urls[] = get_permalink( $post_id );
}, 10, 2 );
When a post is moved to trash, Powered Cache deletes the cache for the pages associated with that post. (such as post type archive, category, author etc..) I’m curious if it causes the delay.
Hi Mustafa!
Adding that code in a child theme function.php makes a post move to trash and restore faster.
Note that, not only is the slowness on moving to trash, it is also slow at restoring from trash.
Also, I do not have Object cache turned on.
-
This reply was modified 3 years, 6 months ago by
macksix. Reason: Added additional info
Hi @macksix,
Thanks for the feedback.
Adding that code in a child theme function.php makes a post move to trash and restore faster.
Note that, not only is the slowness on moving to trash, it is also slow at restoring from the trash.
The same cache invalidation process works whether you move to a post to trash or update an existing public post. We will consider how to make this cache invalidation process faster (or make it async). Meanwhile, you can keep the snippet on your websites.
Also, I do not have Object cache turned on.
Can you tell me more about the hosting environment? Especially what kind of disks running on the server?
Based on our tests with SSD disks, it doesn’t cause a huge delay in deleting all related page’s cache from the server. That process can be slow on HDD disks.
It is a 500GB NVMe SSD drive. It’s my own bare metal 8 core Xenon, 32 GB of RAM, Cloudlinux, Apache, PHP 7.4, MariaDB. It does the same on PHP FPM or mod_lsapi Pro. It’s at the HiVelocity Dallas, TX data center.
The sites use Cloudflare reverse proxy, but turning off the reverse proxy makes no difference. I use a rule so the reverse proxy is bypassed in Admin dashboard anyhow.
-
This reply was modified 3 years, 6 months ago by
macksix. Reason: Added more info
That’s odd. It shouldn’t be such a problem with NVMe.
Thanks for the info. I’ve created an issue about this (in case you want to follow)
How many posts do you have? and Is the cache preloading enabled on your website?
Actually, it would be better if you can export the configuration file and share it with us via support@poweredcache.com.
Unfortunately, it’s not easy to reproduce this issue on our end. This is why we need additional info.
I emailed it. The site has 6,843 posts. Preloading is not enabled.
I am a bug hunting and report expert, so I don’t mind at all. π
I am a bug hunting and report expert, so I donβt mind at all. π
Thanks a lot, appreciated it π
Hi @macksix,
Powered Cache 2.3 is out and this release includes a new feature for purging cache in the background. I’m not sure if it suits your problem but you can give it a try Misc > Async Cache Cleaning option.
Regards,
Marking as resolved. Feel free to re-open it if the problem persists.