Skip to content

Product images to come without caching

<?php namespace CBCdnImagePlugin; use MagentoCatalogHelperImage; class ProductImageCdn { const CDN_BASE_URL = ‘https://cdn.yourstore.com/media/catalog/product/’; public function afterGetUrl(Image $subject, $result) { // Only modify product image URLs, not CMS/static images if (strpos($result, ‘/catalog/product/’) !== false) { return str_replace(‘/media/catalog/product/’, self::CDN_BASE_URL, $result); } return $result;… Read More »Product images to come without caching