magento/magento2 — pull request #727 by Marko-M (2014-11-02 12:07:55+00:00)
Title: Prevent special characters being part of layout handle - Varnish ESI issue

As reported by @blessani here:

https://twitter.com/sonassi/status/528453579452215296

Varnish Page Cache ESI processing at product pages is broken when product SKU contains special characters. This is because SKU gets concatenated into layout handle name, and these are used when creating ESI src URL:

https://github.com/magento/magento2/blob/master/app/code/Magento/PageCache/Model/Observer/ProcessLayoutRenderElement.php#L59

This solution simply urlencodes SKUs before adding them to layout handle.