Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

load balanced magento with edgecast CDN
 
punkgenius
Jr. Member
 
Total Posts:  1
Joined:  2010-06-21
 

We have three webservers running magento, round robin load balanced behind a cisco ACE 4710.

We want to use a CDN (edgecast) for the media portion of magento.

edgecast does customer origin cacheing. That is, if the requested object is not in the cache, it queries our servers (through the load balancer) for the object.

Magento does this with media objects:

http://www.example.com/media/catalog/product/cache/6/image/260x/9df78eab33525d08d6e5fb8d27136e95/p/r/productimage.png

how does magento generate this part: 9df78eab33525d08d6e5fb8d27136e95 ?

is it the same across all servers?

we are discovering that the CDN to load balancer to magento is notworking right-- some images are not showing up

has anyone else used a CDN with load balanced magento instances? How did you do it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Kammersell
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2007-09-21
Las Vegas, NV
 

The code you’re looking for is in Mage/Catalog/Model/Product/Image.php : lines 305-337

$this->_baseFile $baseFile;

        
// build new filename (most important params)
        
$path = array(
            
Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
            
'cache',
            
Mage::app()->getStore()->getId(),
            
$path[] $this->getDestinationSubdir()
        );
        if((!empty(
$this->_width)) || (!empty($this->_height)))
            
$path[] "{$this->_width}x{$this->_height}";

        
// add misk params as a hash
        
$miscParams = array(
                (
$this->_keepAspectRatio  '' 'non') . 'proportional',
                (
$this->_keepFrame        '' 'no')  . 'frame',
                (
$this->_keepTransparency '' 'no')  . 'transparency',
                (
$this->_constrainOnly 'do' 'not')  . 'constrainonly',
                
$this->_rgbToString($this->_backgroundColor),
                
'angle' $this->_angle,
                
'quality' $this->_quality
        
);

        
// if has watermark add watermark params to hash
        
if ($this->getWatermarkFile(){
            $miscParams[] 
$this->getWatermarkFile();
            
$miscParams[] $this->getWatermarkImageOpacity();
            
$miscParams[] $this->getWatermarkPosition();
            
$miscParams[] $this->getWatermarkWidth();
            
$miscParams[] $this->getWatermarkHeigth();
        
}

        $path[] 
md5(implode('_'$miscParams));
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top