• Resolved jameshillyard

    (@jameshillyard)


    Hi,

    I’ve been impressed with W3TC’s performance so far in rebuilding our existing website using WordPress in Docker with Docker Compose, but I have a few questions I’d appreciate some input on. I haven’t been able to find any related articles, but I apologise if this has already been answered.

    Does W3TC support configuration as code through the WordPress CLI, or at least configuring W3TC from a previous export file using the WordPress CLI? If not is it possible to put the export file in a specific directory so that it’s loaded when WordPress is started?

    Secondly, I have configured W3TC with a the Origin Push Amazon CloudFront Over S3 CDN type, and both the upload_path and upload_url_path WordPress options have been configured to the CloudFront CDN endpoint. When I upload media via the wp-admin suite, the new files are not automatically uploaded to the CDN. Is there a configuration I’m missing in W3TC to make this happen? Needing to manually click ‘Upload attachments’ each time would be a deal breaker for me.

    Best Regards,
    James

    Viewing 4 replies - 1 through 4 (of 4 total)
    • Plugin Contributor Marko Vasiljevic

      (@vmarko)

      Hello @jameshillyard

      Thank you for reaching out and I am happy to help!

      The W3 Total Cache does support wp-cli and you can find examples below:

      SYNOPSIS
      
      wp w3-total-cache
      
      SUBCOMMANDS
      
      cdn_purge Purges URL's from cdn and varnish if enabled
      fix_environment Creates missing files, writes apache/nginx rules.
      flush Clear something from the cache.
      import Imports configuration file
      option Get or set option.
      pgcache_cleanup Generally triggered from a cronjob, performs manual page cache Garbage collection
      pgcache_prime Generally triggered from a cronjob, performs manual page cache priming
      querystring Update query string for all static files
      usage: wp w3-total-cache cdn_purge
         or: wp w3-total-cache fix_environment [<server>]
         or: wp w3-total-cache flush <cache> [--post_id=<id>] [--permalink=<post-permalink>]
         or: wp w3-total-cache import <filename>
         or: wp w3-total-cache opcache_flush
         or: wp w3-total-cache option <operation> <name> [<value>] [--state] [--master] [--type=<type>] [--delimiter=<delimiter>]
         or: wp w3-total-cache pgcache_cleanup
         or: wp w3-total-cache pgcache_prime [--start=<start>] [--limit=<limit>]
         or: wp w3-total-cache querystring

      As for the CDN, you are uysing origin push. Push means that you have to manually upload the files, and this is also the case with new files.
      CDN push is old way of doing this and I would advise you to use origin Push

      I hope this helps!

      Thanks!

      Thread Starter jameshillyard

      (@jameshillyard)

      Hi @vmarko,

      Thank you for your response, this looks very promising!

      With regards to the CLI, is there a list of options anywhere to know how I can ‘convert’ each configuration from the Web UI to a WP CLI command?

      Regarding the CDN I’m I’m afraid I don’t understand how I would have configured CDN Push, via the web console I only see Origin Push and Origin Pull as configurable options (Unfortunately it doesn’t look like I can embed images so uploaded to ImgBB https://ibb.co/RgPbDTh) – I’m assuming I’m missing something obvious here!

      Thanks again for your support!

      Best Regards,
      James

      • This reply was modified 6 months ago by jameshillyard. Reason: Screenshot didn't properly upload
      Plugin Contributor Marko Vasiljevic

      (@vmarko)

      Hello @jameshillyard

      Thank you for your feedback.
      Please check out the GitHub repo for more information about wp-cli usage.

      As for the CDN, I meant Origin Push and not CDN push sorry about that! ??
      in the General settings, you can choose between origin pull and Origin Push
      As I can see from the screenshot you are using Origin Push: Amazon CloudFront over S3. Instead, you should configure the CDN with Origin pull: Amazon Cloudfront.
      I hope this clarifies what I tried to say in the previous post.
      Let me know if this helps!

      Thanks!

      Thread Starter jameshillyard

      (@jameshillyard)

      Hi @vmarko,

      Sorry for the long delay, I’ve been out of office and only just had time to get back to this project! With the CLI, that looks very promising, especially the option command – is there a complete list of options or a naming convention I could use to determine the name of each option in relation to its UI component?

      With regards to the CDN, just using Origin Pull seems like it will be a good solution for me – thank you!

      Best Regards

    Viewing 4 replies - 1 through 4 (of 4 total)
    • You must be logged in to reply to this topic.