Assets on Akamai |
[eluser]Warren Noronha[/eluser]
I am currently using Akamai to server static content (css, js, png) all of these reside on assets.mydomain.com. While my application runs on www.mydomain.com. The problem is when I am developing I do not want the the dev box to access Akamai's cached files but the local css, js, png. Rails has this feature (this needs to be set in the production config) Code: ActionController::Base.asset_host = "http://assets.example.com" How do I accomplish this on CI?
[eluser]i_like_ponies[/eluser]
Well my Perl code base does this automatically.... But you could do something like this in your application/config/config.php: Code: // Developer environment Then extend helpers/url_helper.php to have a new function called assets_url. Code: // ------------------------------------------------------------------------ Then just modify your templates/views accordingly so they use asset_url() as the base for all static content links. I believe you can extend the helpers just like you can the other Core libraries. So you should be able to create a "application/helpers/my_url_helper.php" or something that has the new function so you don't have to edit the normal code base. |
Welcome Guest, Not a member yet? Register Sign In |