| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
MaxCDN Content Delivery Solution? | ||||
|
|
Thread Tools |
#21
|
|||||||||
|
|||||||||
Re: MaxCDN Content Delivery Solution?
On our 4.1.x here's how we did our thumbnail and product images.
Open include/func/func.files.php FIND: Code:
BEFORE add: Code:
|
|||||||||
#22
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
Hi Jon!
I tried your code, but as result I get replaced url appended to mydomainname. It looks like: 'http://www.mydomainname.com/http://cdn.example.com/' Any idea?
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#23
|
|||||||||
|
|||||||||
Re: MaxCDN Content Delivery Solution?
Try:
// WCM - CDN Images if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on') { $image_path = str_replace('/home/path/to/your/images/','',$image_path); return str_replace('$http_location','',$image_path); } // / WCM - CDN Images |
|||||||||
#24
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
Brilliant! Thanks Jon.
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#25
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
It doesnt work. All images are blank.
// WCM - CDN Images if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on') { $image_path = str_replace('/home/mydomain/public_html/images/','',$image_path); return str_replace('$http_location','',$image_path); } // / WCM - CDN Images Anywhere I should add my cdn URL?
__________________
x-cart 4.1.10 |
|||||||
#26
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
Yes, you shoud
// WCM - CDN Images if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on') { $image_path = str_replace('/home/mydomain/public_html/images/','your_cdn_address',$image_path); return str_replace('$http_location','',$image_path); } // / WCM - CDN Images
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#27
|
|||||||
|
|||||||
MaxCDN Content Delivery Solution?
Thanks I tried it out about a month ago and it seems to be working quite well.
On our 4.1.x I did notice one thing: 1 - The Detail Images are not being cached, so I added "OR $type == 'D'" and My server load went way up it was hitting Last 1 minute 5.68 Last 5 minutes 17.62 Last 15 minutes 24.81 Below is the Code I used, Not sure what to do next? #// include/func/func.files.php - WCM - CDN Product Images if (($type == 'T' OR $type == 'D' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on') { $image_path = str_replace('/var/www/vhosts/mysite/httpdocs/images/','http://netdna.mysite.com/images/',$image_path); return str_replace('$http_location','',$image_path); } #// / WCM - CDN Product Images Any suggestions?
__________________
Version 4.1.X Last edited by erone123 : 12-29-2010 at 09:57 PM. Reason: grammer |
|||||||
#28
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
Sorry, I didn't get it. What's wrong?
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#29
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
The detail images are being cached by MaxCDN,when I added "OR $type == 'D'" to your code Below is the example.
(($type == 'T' OR $type == 'D' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on') When I added this my server load goes high which makes the website really slow or time out. How do I get the Detail images $type == 'D' to work with with your code with out getting the high server load or time out. |
|||||||
#30
|
|||||||
|
|||||||
Re: MaxCDN Content Delivery Solution?
Can you make a screenshot of FireBug's 'Net' tab?
Normally it should not happen, becouse this code only replace image address. Is there any other modifications related to detailed images?
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
|
|||
X-Cart forums © 2001-2020
|