WordPress.org

Forums

WP Super Cache
Manually delete the cache (5 posts)

  1. lookslikepat
    Member
    Posted 2 years ago #

    I have over 18.000 posts, so clearing the cache via the options page is a hassle, constant 500 errors until everything is deleted. Don't get me wrong, it works, but I was wondering if I could just as well clear it via SSH?

    Would this command work? Or will wp-super-cache complain / run into problems if I don't use it's own php functions to clear all files?

    find /www/wp-content/cache/ \( -name '*.html' -or -name '*.html.gz' \) -delete

    (The command deletes all .html and .html.gz files)

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. lookslikepat
    Member
    Posted 2 years ago #

    After trying it a few times I can't find any errors popping up. I added *.meta files to be deleted as well.
    Here's my final ssh command:
    ssh user@host "find /www/wp-content/cache/ \( -name '*.html' -or -name '*.html.gz' -or -name '*.meta' \) -delete"

  3. lookslikepat
    Member
    Posted 2 years ago #

    For anyone that reads this I switched to an even better solution: moving the cache folder first, then deleting it. Should save you from any PHP collisions.

    cd www/wordpress/wp-content
    # example folder
    mv ./cache ./cache_old && mkdir -p ./cache
    # move cache and if moved make new dir
    if [ -d ./cache_old ] && [[ "$PWD" =~ www/wordpress/wp-content ]]; then
      # if previous cmd was a success and
      # we're in the right folder
      rm -rf -- cache_old
      # the -- is a safeguard thing when using rm -rf
    fi
  4. FirePips
    Member
    Posted 2 years ago #

    Could there be a much easier solution for a non technical people. I offer Forex Signals on website which are sent in real time. I noticed that after installed plugin I need to manually clear cache every time I post a signals. Sometimes even after clearing cache it takes 10-15 mins before signals are delivered.

    Since the nature of business is time sensitive I'd to uninstall the plugin in order to deliver content in real-time.

  5. lookslikepat
    Member
    Posted 2 years ago #

    Could there be a much easier solution for a non technical people.

    wp-super-cache does try and offer options that lets you delete the cache whenever you make new post, a comment is made, or both. Check Settings -> WP-Super-Cache -> Advanced.

    Or you could expand when it deleted the cache using add_action, check out this forum-thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic