CLI commands for Staq cache

Table of Contents
    square-for-kb1
    wp-version

    Scenario

    This knowledge base articles applies in the even that you wish to clear the cache for an individual page on a periodic period without dumping the site’s cache.

    In this example, you’re using Staq cache.

    CLI Commands

    Below are a list of CLI commands:

    • wp wpstaq clear-cache –post_id=[post_ID]
    • wp wpstaq clear-pagebuilder-cache
    • wp wpstaq cloudfront-invalidate-paths <object_paths>
    • wp wpstaq disable-cache
    • wp wpstaq enable-cache
    • wp wpstaq generate-site-critical-css
    • wp wpstaq preload-cache
    • wp wpstaq refresh-internal-cache
    • wp wpstaq s3-offload
    • wp wpstaq s3-offload-patch-resized
    • wp wpstaq verify-iam-keys

    To suit the scenario above, use command, wp wpstaq clear-cache --post_id=xxxx (you can copy this and follow the steps below but replace xxxx with the PostID number)

    Retrieve the page ID

    Inside WordPress, visit the edit page that you wish to clear the cache for that particular page and in the URL bar, retrieve the ID number:

    The command above can be executed either via a WP CLI or Cron Manager.

    WP CLI

    Inside Staq Panel for that website, click WP CLI:

    Then, run the command:

    Running the CRON JOB

    If you wish to automate the process so that you don’t have to do manually, it’s very simple to do.

    In Staq Panel, click Cron Manager:

    Click Add and then select the Job Interval i.e. 1 hour. Then, under the command:

    Try Staq
    Everything WordPress in one place. Simplify WordPress, streamline your flow
    square-for-kb3