WooCommerce and ShimmerCat Accelerator

WooCommerce  + ShimmerCat

If you answer "Yes" to most of the questions above, then you have come to the right place. This tutorial is for you!

Prerequisites

We will assume that you have either:

In any of those cases you should already have created:

You should also have your WooCommerce store deployed somewhere, and note that you don't need to change anything on your backend to test the tutorial. We have a WooCommerce demo store deployed using the ShimmerCat Accelerator and serving the WooCommerce backend with FastCGI. It is a way of deploying it, but you could also have your WooCommerce store deployed with Apache, and deploy edges servers using HTTP as fetch backend as well. If you need help with a different deployment process don't hesitate to contact us at ops@shimmercat.com or through our ticket system..

We are sharing most of the configuration we have done on the demo to guide you with a practical example. See below.

The devlove.yaml file:

Most of the Woocommerce applications will have similar content to the one below, but if you have any questions or feedback, don't hesitate to contact us at ops@shimmercat.com or through our ticket system.

We used fastcgi as consultant on the WooCommerce demo store, as you can notice below. In the devlove.yaml in the install-dir of your sc_pack, fill-in content similar to the one below, taking care of changing the connect-to and the domain names after elec with values that match your desired configuration:

---
shimmercat-devlove:
    domains:
        elec demo-woocommerce.shimmercat.com:
            root-dir: /www/demo-woocommerce.shimmercat.com
            views-dir: views-dir
            consultants:
                default: {application-protocol: fastcgi, connect-to: 'lookup(store-ip-address):port',document-root: /var/www/html/}
            change-url:
              - /wp-admin/ -> /wp-admin/
              - /wp-admin/<php_file:/([a-z0-9-]+).php/> -> /wp-admin/<php_file.1>/
              - /wp-config.php -> redirect_301 https://www.youtube.com/watch?v=y1dPQBEIixg
              - /wp-login.php -> /login/
              - /.well-known//+/ -> /.well-known/<+>
              - /.well-known//+ -> /.well-known/<+>
              - //+</\.(js|css|jpg|png|gif|bmp|txt|svg|woff2|woff|ttf|json)/> -> <*>
              - / -> /target/+common/
              - //+/ -> /target/+common/<+>
            changelist-settings:
                tOld: 72000
                tNew: 20

Important notes: - For simplicity, and because it is common, we have assumed that the pretty permalinks have been enabled (i.e. https://demo-woocommerce.shimmercat.com/%postname%/). In another case with a small adjustment in the devlove file we can serve any other structure of the url.

To know more about the fetch backends ShimmerCat supports take a look here.

A set of views for WooCommerce

Create all the directories, and files we list below under the sc_pack's install-dir + devlove.yaml's views-dir directory. For instance, if your sc_pack installation directory is /home/shimmercat/test/shimmercat-accelerator and the devlove.yaml contains views-dir: views-dir, then the first view listed below should be at /home/shimmercat/test/shimmercat-accelerator/views-dir/target/+common/index.html.

<!--
shimmercat:
    change-url:
       - /target/+common/ -> /index.php
    content-disposition: replace
-->
<!--
shimmercat:
    change-url:
       - /target/+common//+/ -> /index.php
    content-disposition: replace
-->
<!--
shimmercat:
  content-disposition: replace
  change-url:
     - /target/+common/no-slash//+/ -> /index.php
-->

<!--
shimmercat:
  content-disposition: replace
  change-url:
     - /target/+common/slash//+/ -> /index.php
-->
<!--
shimmercat:
    change-url:
       - /target/+common/pub/static//+ -> /pub/static/<+>
    content-disposition: replace
-->
<!--
shimmercat:
    change-url:
       - /target/+common/login/ -> /wp-login.php                                                                                                                                                                                                                            
    content-disposition: replace
-->
<!--
shimmercat:
    change-url:
       - /target/+common/login/ -> /wp-login.php                                                                                                                                                                                                                            
    content-disposition: replace
-->
<!--
shimmercat:
   content-disposition: replace
   change-url:
     - /target/+common/wp-admin/ -> /wp-admin/index.php
-->
<!--
shimmercat:
   content-disposition: replace
   change-url:
     - /target/+common/wp-admin/<filename>/ -> /wp-admin/<filename>.php
-->

If you want to know more about the rules and views we wrote above, please read: URL handling and re-writes and Views and devlove.

To run the service, you can use the command:

$ sc_pack supervisord

You can also start it at boot time.

As usual when testing a website locally:

Again don't hesitate to contact us at ops@shimmercat.com or through our ticket system if you need our help with that.

Thanks a lot for your time, and keep reading!