Magento and ShimmerCat Accelerator

Magento + 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 Magento store deployed somewhere, and note that you don't need to change anything on your backend to test the tutorial. We have a Magento demo store deployed using the ShimmerCat Accelerator and serving the Magento backend with FastCGI. It is a way of deploying it, but you could also have your Magento 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 Magento 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 Magento 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-magento.shimmercat.com:
            root-dir: /www/demo-magento.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:
                - /pub/static/<version>//+</\.(html|js|css|ico|jpg|png|gif|bmp|txt|svg|woff2|woff|ttf|json)/> -> /pub/static/<+>
                - //+</\.(js|css|jpg|png|gif|bmp|txt|svg|woff2|woff|ttf|json)/> -> <*>
                - / -> /target/+common/
                - //+/ -> /target/+common/slash/<+>
                - //+ -> /target/+common/no-slash/<+>/
            changelist-settings:
                tOld: 72000
                tNew: 20

Important notes:

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

A set of views for Magento

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
-->

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!