Hello,
Zen Cart is not designed for placing images remotely, such as at a CDN service.
However, I wonder if someone has been able to manage a patched up solution to this.
I was able to place the stylesheet in a CDN in this way:
includes/templates/your_template/common/header_html.php
around line 43:
substitute:
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
with:
echo '<link rel="stylesheet" type="text/css" href="http://your_link_to_your_CDN/cdn_path/stylesheet.css" />'."\n";
Where,
your_template = your template
cdn_path = what ever the path to wherever in your CDN you've placed your stylesheet(s)
your_link_to_your_CDN = whatever link you are using to fetch files from your CDN
This works like a charm, and has saved quite a bit of latency time in the case of our site.
However, most of the latency time in the front-end comes from the images. It's easy to end up with 30 or 40 images in some pages, and sometimes the number of requests can be 50 or more. This is a normal situation these days.
Perhaps, it is possible to trick zen cart to fetch images from a CDN using the same technique I used for the style sheets. However, I'm still looking where are those magic 'echo' statements where the path to the CDN can be placed safely.
Although this system would make the system to manage images more involved (having to upload normally, and then also keeping track of what's in the CDN, among other things), it would reduce dramatically the latency times of the front-end.
If somebody has played with this, please let me know. In the mean time I'll keep trying, and post here when I succeed.
Thanks.
Bookmarks