Category: X-Cart Tutorials
Posted: Aug 30, 2010
Comments: 1 [
Read/
Post]
Synopsis: Having had the opportunity to setup MaxCDN for a number of X-Cart sites we've found this solution to be the most reliable to deliver non-https visitors their content from a CDN.
Setting up a CDN for your medium to large X-Cart site will help improve its loading times across the world by delivering static content from the MaxCDN server located closest to your customer. Google uses site loading times as a factor in search engine ranking so for sites with steady sales and traffic we recommend implementing a CDN like MaxCDN.
Once your CDN has been established, you can integrate x-cart as follows:
Open smarty.php
Find:
$smarty->assign("SkinDir",$xcart_web_dir."/skin1");
$smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");
Replace with:
(Be sure to replace CdnUrl.example.com with your CDN Url)
// 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");
}