• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double view page render

#1
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
Reply

#2
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.
Reply

#3
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.
Reply

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.