Serve Images from CDN

My store is located at store.domain.com. I have a content delivery network set up at cdn.domain.com. Both domains can deliver content:

http://store.domain…es/icons/go.gif

  • OR -

    http://cdn.domain.co…es/icons/go.gif



    In /core/fn.init.php, I found a 'images_dir' variable:


$view->assign('images_dir', Registry::get('config.full_host_name') . Registry::get('config.current_path') . (str_replace(DIR_ROOT, '', $skin_path)) . '/' . AREA_NAME . "/images");


How can I override this variable to serve images from the CDN?

why don't you use cloudflare?

I've thought about CloudFlare. Any caveats using it with CS-Cart?

[quote]

How can I override this variable to serve images from the CDN?

[/quote]

In an addons/my_changes/index.post file use something like:

```php

Registry::get('view')->assign('images_dir', "whatever_value_you_want");
?>

```

wont work for product images… becaus it looks in a thumb dir to see if there if not it creates it… then serves it…



we need a flag use_cdn and then bypass in core/fn.images.php



still working on that …