SUPEE-9697 has broken the Design Exceptions functionality of Magento Enterprise with Full Page cache. This feature is normally used for serving a mobile theme.

To recreate the issue (with full page cache enabled and a design exception defined):

  • Flush full page cache.
  • In Chrome, enable developer tools and toggle the device toolbar.
  • Switch to a device which will activate your theme (e.g. an iPhone).
  • Visit the site and confirm you see your mobile theme.
  • Toggle the developer tools device toolbar so you now see a desktop view.
  • Refresh the page.

Undesirable behaviour:

  • You will see that the template being served (by full page cache) is the mobile template, which is incorrect.

2 Answers 2


This issue is caused by the patch using Zend_Json to encode values into the cache in the Enterprise PageCache Observer where previously serialize was used.

The Fix (copy the file to local to avoid editing core):



$exceptions = @unserialize($exceptions);


$exceptions = @Zend_Json::decode($exceptions);
  • Does this solve also user agent exceptions only in layout, even if using the same package? I'm asking so because this is my configuration, and this solution is not working. In $exception variable I can see the values have not been unserialized.
    – Fra H
    Commented Jun 8, 2017 at 10:57
  • It should solve all design exception issues. Did you clear full page cache after applying the fix?
    – cmtickle
    Commented Jun 8, 2017 at 19:06
  • Unfortunately yes. I', running a version, with all patches applied. I'll try to figure out why. Configuration has exceptions only on model, theme, and layout.
    – Fra H
    Commented Jun 9, 2017 at 12:57
  • I even tried to add an exception to the package.. well, the whole thing is not working :(
    – Fra H
    Commented Jun 9, 2017 at 15:13
  • Reverting the patch, the theme exception is working again.
    – Fra H
    Commented Jun 13, 2017 at 8:33

Also on magento v1.13.1 (@thundar) and the code is slightly different than the accepted answer.

It's on line 196 instead of 195 and the original code was:

$rules = @unserialize($exceptions);

Should become:

$rules = @Zend_Json::decode($exceptions);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.