Carabiner 1.4: Asset Management Library |
[eluser]topherdan1[/eluser]
I think I have Amazon S3/CDN integration with Caribinner working pretty well now. Here are the steps I took: 1. Add an S3 library to your application/libraries folder. I used the one available here: http://undesigned.org.za/2007/10/22/amazon-s3-php-class and then customized it so that it pulled the variables from my config file. The only thing I changed in the S3.php file (which is the one to add to application/libraries) was the __construct on line 57 so that it looked like this: Code: public function __construct($accessKey = null, $secretKey = null, $useSSL = true) { 2. Next, update the carabiner config file with the following variables Code: $config['key_id'] = 'XXXXXXXX'; //Your Amazon key_id 3. Finally, modify the carabiner library in two spots: The _cache function should look like this: Code: private function _cache($filename, $file_data) Code: private function _tag($flag, $ref, $cache = FALSE, $media = 'screen') That should be it. Now when you are in a production environment, anytime a new cache file is created it will automatically be loaded into Amazon S3, which can act as a CDN. Then, on the site, the files use the CDN domain instead of the normal domain. Let me know if you have suggestions on how to improve this. |
Welcome Guest, Not a member yet? Register Sign In |