views:

14

answers:

1

I want to make it so that all of my css and JS files are loaded from Amazon s3 since this would make things faster for the end user and save on bandwidth costs since s3 is cheaper than my cloud provider for bandwidth... I am wondering if in my .ctp if I just change this to the full s3 path if cake will have the end user DL it from that url, or if cakephp is going to download it from there and then send it out to the end user from my server (which would defeat what I am trying to do).. if this won't work I would appreciate any suggestions on how to get this to work.. thanks

echo $html->script('http://amazons3fullulrpath/jquery/jquery-1.4.2.min', false);
+1  A: 

The script array just tells Cake where your scripts are located and where to output them in the template, so adding the full path will be fine - Cake will just echo it out in a formatted string.

Use Firebug's Net panel to check the locations of scripts etc while a page loads if you ever get stuck :-)

hollsk
ok cool.. thanks, yeah I wasn't sure how to check it from the browser.. thanks
Rick
In addition to using the Net panel to view request locations, it's also great for identifying slowdowns and bottlenecks in your downloads, so you can see exactly where speed problems are happening and can devise quite tight strategies to cope with them. Definitely stuff worth knowing if you're moving into using CDNs for speed reasons.
hollsk