![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
IP: 112.87.93.182
|
|||
|
|||
|
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 CDN content.
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. X-Cart 4.4/4.5 X-Cart versions 4.4 and can add complexity to a CDN setup when using alternate skin folders and/or javascript/css speed compression settings. Our CDN setup service will evaluate your site and implement the CDN in the way that provides the absolute best speed benefit to your site. If these are not an issue on your site, you can implement as follows: Open smarty.php Find: Code:
$smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir);
Code:
(Be sure to replace cdnurl.example.com with your CDN Url)
// WCM - MaxCDN Implementation
if ($_SERVER['HTTPS'] != 'on')
{
$smarty->assign('ImagesDir', "http://cdnurl.example.com" . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir', "http://cdnurl.example.com" . $smarty_skin_dir);
}
else
{
$smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images');
$smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir);
}
X-Cart 4.3 and lower For X-Cart versions 4.3 and lower, you can implement a CDN fairly easily as follows: Open smarty.php Find: Code:
$smarty->assign("SkinDir",$xcart_web_dir."/skin1");
$smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");
Code:
(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");
}
// / WCM - MaxCDN Implementation
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Modify Zen Cart to Use External Images | 上海公司注册 | ZenCart | 0 | 2012-06-21 11:56 AM |
| 有关Zen Cart的一些常用操作 | yahoo | ZenCart | 0 | 2009-12-01 09:36 PM |
| How to Install an Zen Cart Template | topvip | ZenCart | 0 | 2009-08-23 05:35 PM |
| X-Cart Multiple Input Validation Holes Permit SQL Injection and Cross-Site Scripting | topvip | X-Cart | 0 | 2009-07-21 10:03 AM |
| x-cart Template Editing Guide for 4.1.x | topvip | X-Cart | 0 | 2009-04-15 11:42 PM |