网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > X-Cart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 112.87.93.182
Old 2015-03-31, 12:43 AM
Xzavier Xzavier is offline
初级会员
 
Join Date: 2010-12-14
Posts: 4
Xzavier 现在声名狼藉
Default How To Setup MaxCDN On X-Cart

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);
Replace with:
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");
Replace with:
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
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:09 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.