Full Page Cache Bolt Full Page Cache

Configuration for Multi-store

Bolt Full Page Cache is fully compatible with Magento multistore and assuming your Magento multi-store is setup correctly, there is no need to configure Bolt Full Page Cache in any special way for a Magento multi-store installation. That being said, not all Magento multi-stores are configured correctly.

The common issue with Bolt Full Page Cache and Magento multi-store is around the loading of the correct store. This is either done in 2 ways:

  • .htaccess enviroment variables that set $_SERVER['MAGE_RUN_CODE'] and $_SERVER['MAGE_RUN_TYPE'].
  • A switch or if/else statement in Magento's index.php file.

If you use the first option, Bolt Full Page Cache will load the correct store automatically. If you opted for the second method, depending on how you did it, you may need to make a small modification so that Bolt Full Page Cache can correctly load the store.

Open Magento's index.php file and scroll down the switch or if/else code that you have added. If this code sets the $_SERVER['MAGE_RUN_CODE'] and $_SERVER['MAGE_RUN_TYPE'] variables, Bolt Full Page Cache will load the correct store. If you set the local variables $mageRunCode and $mageRunType, Bolt won't be able to read these values. To fix this issue, change $mageRunCode for $_SERVER['MAGE_RUN_CODE'] and $mageRunType for $_SERVER['MAGE_RUN_TYPE']. You should also move your switch or if/else above the following lines:

/**
 * ADD YOUR SWITCH OR IF/ELSE HERE
 * Ensure it sets $_SERVER['MAGE_RUN_CODE'] and $_SERVER['MAGE_RUN_TYPE'] 
 * And don't set $mageRunCode and $mageRunType
 **/

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

/* Include bolt.php */
@include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bolt.php');

Mage::run($mageRunCode, $mageRunType);
Post your comment

FishPig Ltd