Welcome Guest, Not a member yet? Register   Sign In
Double view page render
#1

(This post was last modified: 03-26-2016, 07:12 AM by kavvson.)

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




Theme © iAndrew 2016 - Forum software by © MyBB