Using Fasterize with Magento

Modified on Wed, 2 Oct at 3:46 PM

Introduction

To use the Fasterize solution correctly with Magento and avoid disruption to the operation of your site, it is recommended that you configure certain specific Magento parameters to ensure optimum performance.


Explanation

Magento, by default, has some options that can cause compatibility problems with Fasterize, including the session in Magento must be disabled to avoid errors caused by IP changes, proxies, and variations in the User-Agent. This ensures that the session remains active even when using Fasterize.


Solution

Here are the recommended settings to configure in the Magento administration interface:


1. Configuring session validation settings

Go to System -> Configuration -> Web -> Session Validation Settings.

Here are the recommended settings:

Use SID on Frontend": This parameter should be set to “No” if you are not using multiple domains on the same             Magento instance. Otherwise, it could cause the GET ___SID parameter to be added to URLs, thus disrupting                 the cache.

  The other three parameters (IP, User-Agent, and Session Validation) must be set to ‘No’, as traffic from the same user may come from several different IP addresses when Fasterize is used.



2. Deactivating CMS redirection if cookies are disabled

Go to System -> Configuration -> Web -> Browser Capabilities Detection.

The ‘Redirect to CMS-page if Cookies are Disabled’ parameter must be disabled. Visitors served by Fasterize will not receive cookies until they have added a product to their basket or logged in. This option could therefore disrupt their browsing.


3. Magento patch for adaptive design

To align code detection between Fasterize and Magento, Fasterize provides the x-user-agent-class HTTP header in requests. You can apply a patch in Magento to ensure that this detection works correctly.


Here is a patch used by one of our customers on the getDeviceType method.

// patch for the adaptative design with Fasterize

if (isset($_SERVER['HTTP_X_USER_AGENT_CLASS'])) {

  switch ($_SERVER['HTTP_X_USER_AGENT_CLASS']) {

    case "old":

    case "bot":

    case "desktop_recent":

      return "d";

    case "tablet":

      return "t";

    case "mobile":

      return "m";

    default:

      return "d";

  }

}

// end patch for the adaptative design with Fasterize


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article