CodeIgniter Forums
Double view page render - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Double view page render (/showthread.php?tid=64784)



Double view page render - kavvson - 03-25-2016

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


RE: Double view page render - kilishan - 03-25-2016

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.


RE: Double view page render - michalsn - 03-25-2016

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.


RE: Double view page render - kavvson - 03-26-2016

Well is there any other method? I don't want to use glup really