How to install and configure StarterMage
This article describes how to install and configure StarterMage, the caching solution for Magento on Cloudflare servers. Follow the procedures in the section below for your version of Magento.
Magento 2
First you must install StarterMage, and then activate it in the Magento administration panel.
Installing StarterMage
To install StarterMage on Magento 2, follow these steps:
- Access your account using SSH.
- Change to the directory where Magento is installed. For example, type cd ~/public_html/magento.
- At the command prompt, to set Magento to developer mode, type the following command:
php bin/magento deploy:mode:set developer
To download the StarterMage plugin files, type the following command:
wget https://github.com/Starterspeedtech/magento2-StarterSpeed_StarterMage/archive/master.zip
To extract the files in the .zip file, type the following command:
unzip master.zip
To create a directory for the StarterMage plugin files, type the following command:
mkdir -p app/code/Starterspeed/Startermage
You must create this directory path relative to the Magento 2 root directory. Otherwise, Magento cannot detect that the plugin is installed.
To move the unpacked StarterMage plugin files to the new directory, type the following command:
mv magento2-StarterSpeed_StarterMage-master/* app/code/Starterspeed/Startermage/
After you move the files, make sure that they have the same ownership as all of the other Magento files. If they do not, use the chown command to set the correct ownership. For example, you can type chown -R username:username * , where username represents your account username.
To enable the StarterMage plugin, type the following command:
php bin/magento module:enable Starterspeed_Startermage
To make the plugin settings available to the Magento Admin panel, type the following command:
php bin/magento setup:upgrade
To recompile Magento, type one of the following commands:
- If you are running Magento version 2.0.6 or later and have only one Magento store, type the following command:
php bin/magento setup:di:compile
Alternatively, if you are running Magento version 2.0.5 or earlier or have multiple Magento stores, type the following command:
php bin/magento setup:di:compile-multi-tenant
To set Magento back to production mode, type the following command:
php bin/magento deploy:mode:set production
If you receive an error message running this command, repeat step 10, and then try again.
Using the cPanel File Manager or the SSH command prompt, open the .htaccess file in the Magento root directory in your preferred text editor, and then:
Activating StarterMage
To activate StarterMage on Magento 2, follow these steps:
- Log in to Magento as the administrator.
- In the left sidebar, click STORES, and then click Configuration.
- Click ADVANCED, and then click System.
- Click Full Page Cache.
- In the Caching Application list box, confirm that StarterMage Cache within StarterSpeed Server is selected. If StarterMage Cache within StarterSpeed Server is not selected, select it in the Caching Application list box, and then click Save Config.
- In the left sidebar, click SYSTEM, and then click Cache Management.
- Select the Configuration and Page Cache check boxes.
- In the list box above the table, select Refresh, and then click Submit.
To verify that the StarterMage installation is working correctly, follow the
Verifying StarterMage procedure below.
Magento 1
First you must install StarterMage, and then activate it in the Magento administration panel.
Installing StarterMage
To install StarterMage on Magento 1, follow these steps:
- Using the cPanel File Manager or the SSH command prompt, open the .htaccess file in the Magento root directory in your preferred text editor, and then:
- Log in to Magento as the administrator.
- On the top menu bar, click System, and then click Configuration.
- In the left sidebar, under GENERAL, click Web.
Click Session Validation Settings, and then in the Use SID on Frontend list box, select No, and then click Save Config.
If you currently have compilation enabled, you must disable it. To do this, on the top menu bar click System, click Tools, and then click Compilation. Click Disable at the top right.
- On the top menu bar, click System, click Magento Connect, and then click Magento Connect Manager. This step takes you away from the administrator interface and you must type the Magento administrator username and password again.
Get the StarterMage Extension from Magento Connect:
Activating StarterMage
To activate StarterMage on Magento 1, follow these steps:
- Log in to Magento as the administrator.
- On the top menu bar, click System, and then click Configuration.
- In the left sidebar, under StarterMAGE CACHE, click StarterMage Configuration.
If you receive a 404 Not Found error message, log out of Magento and then log back in.
- Click General Settings, and then in the Enable StarterMage Cache list box, select Yes.
- Click Save Config.
- On the top menu bar, click System, and then click Cache Management.
- Under Cache Storage Management, select the Configuration check box, and then click Submit. This refreshes the configuration cache.
To verify that the StarterMage installation is working correctly, follow the
Verifying StarterMage procedure below.
Verifying StarterMage
To ensure that StarterMage is working correctly for your site, follow these steps:
- Use your web browser to visit a page that is cache-enabled.
- Open the web browser inspector by right-clicking the page, and then click Inspect.
The exact wording for the Inspect option, as well as the options in the following steps, may vary depending on the browser you are using.
- Select the Network tab, and then refresh the page.
- Select the item from the list that corresponds to the current HTML page (this is usually the first item ending in .html).
- Under Headers, if you see the following response header, then StarterMage is working correctly:
X-StarterSpeed-Cache: hit,Startermage
Alternatively, if you see the following header, refresh the page and check again:
X-StarterSpeed-Cache: miss,Startermage
Related Articles