• Resolved ulicgn

    (@ulicgn)


    Using WP Super Cache in an oldstyle Webhosting environment was easy:
    1) enable plugin
    2) enable caching in plugin settings and configure
    3) done for good
    Just like every other plugin in the world 😉

    Now we deploy our WordPress Sites into a docker environment from a clean git repo checkout using CI/CD tools, and we’re encountering difficulties fully enabling WP Super Cache after every deployment.

    In addition to setting WP_CACHE and WPCACHEHOME (which is done upon deployment), we have to do multiple manual or script-driven steps.

    After every fresh deployment, wp-cache-config.php and advanced-cache.php are missing – since they are generated at runtime and contain dynamic information, we can not keep them in the repo. Also the configuration values are not persistent in wp_options, thus every fresh deployed container is coming up unconfigured with no caching in spite of wpsc being enabled. Then, we have to:

    1) trigger creation of advanced-cache.php
    ( using wp_cache_create_advanced_cache() )
    2) trigger creation of wp-cache-config.php
    ( using wp_cache_verify_config_file() )
    3) re-configure the plugin-settings, specifically set cache_enabled and super_cache_enabled to 1, otherwise no caching at all takes place
    ( using a lot of wp_cache_setting() calls )

    I was hoping there would be wpcli commands to enable and configure WPSC, but it seems as if these are no longer present in 3.x (right?) So we were forced to create a plugin that exposes a wpcli command to perform all the listed activities using the global functions we found in wp-cache.php (not sure whether I picked the best ones ). This wpcli command is then being called after deployment.

    This kind of works, but is very clumsy and errorprone, and I lost my trust that the cache will be present after every deployment.

    Bottom Line:
    What is the most reliable and efficient way to either programmatically enable WPSC in a CD/CI environment, or to keep its activation and configuration persistently in the DB like regular plugins do? Are there any best practices, recommended hooks, or alternative methods within WPSC itself?

    Regards,
    Ulrich

Viewing 1 replies (of 1 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @ulicgn,

    Thanks so much for taking the time to think about how things could work better.

    Regarding your suggestion, you’re right that having stock wp-cache-config.php and advanced-cache.php files ready to copy into new installs could be helpful in certain setups.

    However, I do want to be upfront that WP Super Cache is currently in maintenance mode, so we’re not actively developing new features or adding things like a WP-CLI interface at this time.

    If you’d like, you’re more than welcome to submit a PR in the repository with any improvements or additions you have in mind. We do review community PRs when we can, and if everything checks out, we’re happy to release them. But just to set expectations, we can’t guarantee a timeline for that.

    I have asked our developers to chime on this, so they’ll reply to you as soon as they can – not earlier than next week anyway.

    Hope that helps! Thanks again for your input – it really does help us keep the plugin stable and useful for everyone 🙂

    • This reply was modified 4 months, 2 weeks ago by Stef (a11n).
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.