Output Minification (Minifying html,css,js) CI 3.x |
CI 3.x supports compression library or remove space html, css, js not?
Hocphp.info - Learn Codeigniter starting from the basics correctly with this Codeigniter tutorial
I have configured
$config['compress_output'] = TRUE; but view page source remains unchanged,still spaces Thanks for support demo: http://hocphp.info/CodeIgniter-3.0.0/index.php/welcome
Hocphp.info - Learn Codeigniter starting from the basics correctly with this Codeigniter tutorial
Are you worried about the HTML, or the CSS/JS? You should probably include your CSS and JS separately, and use a library for minification like https://github.com/slav123/CodeIgniter-minify.
(05-25-2015, 08:13 AM)nobitacnt Wrote: I have configured Try this to remove spaces, line-feeds, etc: PHP Code: //==============================================
Thanks for support, in wordpress plugins great Autoptimize (Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.).If the library ci 3.x support like this is good
Hocphp.info - Learn Codeigniter starting from the basics correctly with this Codeigniter tutorial
You can use tools like grunt to do that. It will take all of your various source css and js files, concatenate them into single files, minify them, etc. No need for a framework to reinvent the wheel when there are existing popular tools that do it. Just use existing technologies that are in wide use...like grunt. http://24ways.org/2013/grunt-is-not-weird-and-hard/
There are also some PHP libraries which will minify/concatenate CSS/JS files, like CssMin and JSMin. These are usually fairly easy to adapt for use in CI. When using these libraries, though, I would highly recommend checking for the output file(s) before loading/calling the library, so you only generate the file(s) as needed, and can easily supply a pre-minified file if there are any issues with the library's output.
|
Welcome Guest, Not a member yet? Register Sign In |