• Resolved macksix

    (@macksix)


    I have sites and in the worst case, 2 of them running powered cach took 15 seconds to move a post to trash. I found that turning the powered cache off and back on fixed the problem.

    I could move the file out of trash back active and then repeat and it would still take 15 seconds to move back to trash.

    Another site, it was taking 3 seconds to move a post to trash and clearing cache fixed it. I saw the same thing occur on a 4th site.

    WordPress 5.9.3, Poweredcache Version 2.2.1

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    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.

    Thread Starter macksix

    (@macksix)

    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
    Plugin Author Mustafa Uysal

    (@m_uysl)

    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.

    Thread Starter macksix

    (@macksix)

    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
    Plugin Author Mustafa Uysal

    (@m_uysl)

    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.

    Thread Starter macksix

    (@macksix)

    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. πŸ™‚

    Plugin Author Mustafa Uysal

    (@m_uysl)

    I am a bug hunting and report expert, so I don’t mind at all. πŸ™‚

    Thanks a lot, appreciated it πŸ™‚

    Plugin Author Mustafa Uysal

    (@m_uysl)

    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,

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Marking as resolved. Feel free to re-open it if the problem persists.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Moving Posts to Trash Slow Unless Cache Disabled and Enabled Again’ is closed to new replies.