X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   MaxCDN Content Delivery Solution? (https://forum.x-cart.com/showthread.php?t=55319)

kgoel 01-29-2011 08:08 PM

Re: MaxCDN Content Delivery Solution?
 
Can anyone help us in setting the MaxCDN ? for caching the site images, product images, js and css files?

albertchui 02-03-2011 10:51 AM

Re: MaxCDN Content Delivery Solution?
 
HI, my site has over 150 thousands items and i have filters which was created by xcart, however the filter somehow is very slow and sometime crash with database of sql Error code : 1064. my question is will MaxCDN help my situation, thanks

albert

Stizerg 02-05-2011 02:42 PM

Re: MaxCDN Content Delivery Solution?
 
albertchui - MaxCDN can't help you with sql Error. Code 1064 means there is syntax error somewhere. Post your question here http://forum.x-cart.com/forumdisplay.php?f=13 , so SQL gurus can help you.

teriwinkle 03-21-2011 09:05 PM

Re: MaxCDN Content Delivery Solution?
 
I started to use MaxCDN, but I noticed that detail images would no longer pop up while MaxCDN was activated (via smarty code), nothing would happen at all when you click the view detail images. So I put the original smarty.php code back and immediately can view detailed images.

Anyone know why MaxCDN would effect the detailed images popup function? Thanks
xcart 4.4.2

My code:

// WCM - MaxCDN Implementation
if ($_SERVER['HTTPS'] != 'on')
{
$smarty->assign("SkinDir","http://mydomaincdn-url/skin1");
$smarty->assign("ImagesDir","http://mydomaincdn-url/skin1/images");
}
else
{
$smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir);
}

koz 05-18-2011 09:23 AM

Re: MaxCDN Content Delivery Solution?
 
There are two threads about this going right now.. Ugh.

The code, I think, that has to be edited is the code for the AltSkin in smarty.php -- i just can't figure it out.

TA 06-09-2011 09:41 AM

Re: MaxCDN Content Delivery Solution?
 
I can't get MaxCDN to work. When I enable it, I get an all text website, no images. If I go into https://www.domain.com, it is all back to normal, so that tells me the code is bypassing https pages, which is good.

I tried this with and with out public_html in the path. Same results.

And of course, I changed "mydomain".

Quote:

// WCM - MaxCDN Implementation
if ($_SERVER['HTTPS'] != 'on')
{
$smarty->assign("SkinDir","http://maxcdn.mydomain.com/public_html/skin1");
$smarty->assign("ImagesDir","http://maxcdn.mydomain.com/public_html/skin1/images");
}
else
{
$smarty->assign("SkinDir",$xcart_web_dir."/skin1");
$smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");
}
// WCM - MaxCDN Implementation


Quote:

// WCM - CDN Images
if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on')
return str_replace('/home/public_html/skin1/images/','http://maxcdn.mydomain.com/',$image_path);
// / WCM - CDN Images


Quote:

maxcdn.mydomain.com 14400 IN CNAME xxxxxxxxxxxxpullzone.mydomain.netdna-cdn.com.


In my MaxCDN CP

Quote:

Custom Domains
  • maxcdn.mydomain.com
  • CNAME to
    xxxxxxxxxxxxpullzone
    .mydomain.netdna-cdn.com


Can anybody help?

TA 06-09-2011 01:02 PM

Re: MaxCDN Content Delivery Solution?
 
Okay, I got it mostly working. I ended up having to use url xxxxxxxxxxxxpullzone.mydomain.netdna-cdn.com instead of the maxcdn.mydomain.com in smarty.php.

I still cannot get the images to show up. T, P or D. Some will show from a cat directory and C, but not the others.

TA 06-09-2011 01:56 PM

Re: MaxCDN Content Delivery Solution?
 
This just in... ](*,)

The reason I had to use the temp. URL was DNS has to do it's thing before the other URL will work.

Here is what I ended up with that finally brought my images up.

Code:

// WCM - CDN Images
        if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on')
    return str_replace('/home/xxxxxxx/public_html/images/','http://xxxxxxxxxxxxxx.netdna-cdn.com/images/',$image_path);
// / WCM - CDN Images


Putting /images at the end made it work. All fixed and running now.

inkcarts 06-23-2011 08:47 AM

Re: MaxCDN Content Delivery Solution?
 
Jon,
Does this same maxcdn code work in 4.4?

Jon 06-23-2011 09:14 AM

Re: MaxCDN Content Delivery Solution?
 
It's a bit different on 4.4 but the principle is the same, just the exact code is a bit different. Probably this would work:

FIND:

Code:

$smarty->assign('ImagesDir',        $xcart_web_dir . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir',          $xcart_web_dir . $smarty_skin_dir);


REPLACE WITH:

Code:

// WCM - MaxCDN Implementation
if ($_SERVER['HTTPS'] != 'on')
{
$smarty->assign('ImagesDir', 'http://CdnUrl.example.com//images');
$smarty->assign('SkinDir', 'http://CdnUrl.example.com/');
}
else
{
$smarty->assign('ImagesDir',        $xcart_web_dir . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir',          $xcart_web_dir . $smarty_skin_dir);
}
// WCM - MaxCDN Implementation



All times are GMT -8. The time now is 06:08 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.