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)

inkcarts 08-30-2010 11:25 AM

MaxCDN Content Delivery Solution?
 
I'm interested in giving maxcdn a shot, however I'm concerned with how it will handle the https in my shopping cart.

Anyone have a solution that will allow me to use maxcdn for the non-https, and serve from the main server for https?

Thanks In Advance!
Lyn

Jon 08-30-2010 01:39 PM

Re: MaxCDN Content Delivery Solution?
 
I've experimented with different configurations but this principle has proved the most effective:

Open smarty.php

FIND:

Code:

$smarty->assign("SkinDir",$xcart_web_dir."/skin1");
$smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");


REPLACE WITH:

Code:

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


inkcarts 08-30-2010 08:02 PM

Re: MaxCDN Content Delivery Solution?
 
Thanks Jon. Does that cover CSS or JavaScript?
Lyn

Jon 08-30-2010 09:39 PM

Re: MaxCDN Content Delivery Solution?
 
Will cover css, javascript, images, and anything else called from the skin1 folder.

inkcarts 08-31-2010 09:18 AM

Re: MaxCDN Content Delivery Solution?
 
Awesome! Thank You!
Lyn

Jon 08-31-2010 10:49 AM

Re: MaxCDN Content Delivery Solution?
 
We've put this up as a tutorial at MaxCDN for X-Cart.

inkcarts 08-31-2010 11:00 AM

Re: MaxCDN Content Delivery Solution?
 
I must be reading this incorrectly, which wouldn't surprise me, but to me, it looks like that code says if https is on, then use max cdn, . . . . shouldn't it be the other way around? Or am I reading that wrong?

Thanks
Lyn

Edit: I must be reading it wrong, because i tried it as you posted, and obviously it works.

Thanks
Lyn

joncampbell 08-31-2010 11:04 AM

Re: MaxCDN Content Delivery Solution?
 
if ($_SERVER['HTTPS'] != 'on')

!= means does not equal.

So if if https is not on it will use CDN, if https is on it will use default x-cart location.

Mdennison 09-01-2010 07:34 AM

Re: MaxCDN Content Delivery Solution?
 
Hi Guys,

What sort of results are you seeing from using a CDN?

Is it worth the additional costs?

How difficult was the deployment?

Thanks,

Matt

Jon 09-01-2010 09:00 AM

Re: MaxCDN Content Delivery Solution?
 
Deployment took a few hours. It did definitely help our speeds especially in foreign countries.


All times are GMT -8. The time now is 09:53 PM.

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