Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

MaxCDN Content Delivery Solution?

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 08-30-2010, 11:25 AM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default 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
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #2  
Old 08-30-2010, 01:39 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default 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
Reply With Quote
  #3  
Old 08-30-2010, 08:02 PM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default Re: MaxCDN Content Delivery Solution?

Thanks Jon. Does that cover CSS or JavaScript?
Lyn
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #4  
Old 08-30-2010, 09:39 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: MaxCDN Content Delivery Solution?

Will cover css, javascript, images, and anything else called from the skin1 folder.
Reply With Quote
  #5  
Old 08-31-2010, 09:18 AM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default Re: MaxCDN Content Delivery Solution?

Awesome! Thank You!
Lyn
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #6  
Old 08-31-2010, 10:49 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: MaxCDN Content Delivery Solution?

We've put this up as a tutorial at MaxCDN for X-Cart.
Reply With Quote
  #7  
Old 08-31-2010, 11:00 AM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default 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
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #8  
Old 08-31-2010, 11:04 AM
 
joncampbell joncampbell is offline
 

Advanced Member
  
Join Date: Apr 2010
Location: Vancouver, BC
Posts: 60
 

Default 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.
Reply With Quote
  #9  
Old 09-01-2010, 07:34 AM
  Mdennison's Avatar 
Mdennison Mdennison is offline
 

Advanced Member
  
Join Date: Feb 2009
Location: Louisville, KY
Posts: 84
 

Default 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
__________________
X-cart 4.2
Lots of Mods
www.outdoorphotogear.com
Reply With Quote
  #10  
Old 09-01-2010, 09:00 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: MaxCDN Content Delivery Solution?

Deployment took a few hours. It did definitely help our speeds especially in foreign countries.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020