CodeIgniter Forums

Full Version: Double view page render
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question do you have any libraries that can help me in asset management as well as managing the client side caching ( since now I got not expire headers )? I saw quite few projects out there like carabinerm but I am not sure if it's worth using it since it's not beeing updated.
Thanks for any tips.

I also use cloudflare
Honestly, your best bet for asset management is to go outside of the PHP world. Projects like gulp are super active with large communities and are probably the way to go.

If you're a small team, or solo, and on a Mac, I'm a big fan of CodeKit.

I thought I'd heard that Laravel Elixir could be used standalone, but I'm not 100% positive.
I use Elixir without any problems in CodeIgniter. I believe it's your best shot.

You'll need this tiny helper, to use Elixir with versioning capability:
PHP Code:
 * Elixir asset helper
 * @param string $file File name
 * @return string
 * @throws \InvalidArgumentException
function elixir($file)
   static $manifest NULL;

   if (is_null($manifest))
       $manifest json_decode(file_get_contents(FCPATH '/build/rev-manifest.json'), TRUE);

   if (isset($manifest[$file]))
       return '/build/' $manifest[$file];

   throw new InvalidArgumentException("File {$file} not defined in asset manifest.");

This helper assume that, you use default paths defined in Elixir.
Well is there any other method? I don't want to use glup really