I'm having an issue where I insert an image into a static block using the WYSIWYG editor. This results in an image tag like this:
<img src="{{media url="image.jpg"}}" />
The problem is that with block caching enabled the block doesn't get cached individually for SSL and non-SSL pages. I.e. if I visit a non-SSL page first and visit the same page again with SSL enabled the src attribute will contain a non-SSL link resulting in the respective warnings (and no green padlock).
This works perfectly fine when the block caching is disabled.
I dug into this and discovered that Magento doesn't seem to generate separate cache ids for SSL and non-SSL requests. I did the following change:
--- app/code/core/Mage/Cms/Block/Block.php 2016-10-12 13:55:55.823302409 -1000
+++ app/code/local/Mage/Cms/Block/Block.php 2016-10-13 08:39:48.307225894 -1000
@@ -86,6 +86,7 @@
'CMS_BLOCK',
$blockId,
Mage::app()->getStore()->getCode(),
+ (int)Mage::app()->getStore()->isCurrentlySecure(),
);
} else {
$result = parent::getCacheKeyInfo();
That fixes the problem. I don't think that this is the correct solution though as this would mean that SSL would be broken for all existing Magento installs (checked 1.9.3 code). Does anybody have an idea what I'm missing here?
Currently running 1.9.2.1 fully patched.