Jump to content


Photo
- - - - -

Minify and Combine Javascript and CSS


  • Please log in to reply
10 replies to this topic

#1 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 18 April 2016 - 11:10 AM

AVS script reads 5 different CSS and 4 different Javascript files everytime when you hit any website page to open.

 

I just released a script that allows to minify those CSS and Javascript files and combine it into one CSS and one JS file.

So instead of 9 http requests for css and js files AVS script now reads only 2 minimized files.

Minimized and combined files are processed on the fly only once, later opened from cache until you change something in one of original javascript or css file.

 

Read more at http://www.nuevolab....ipts/avs/minify

 

 


VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#2 japanisgreen

japanisgreen

    Junior Member

  • Members
  • PipPip
  • 41 posts

Posted 18 April 2016 - 01:20 PM

Sounds like your re-selling a FREE script like minify or similar plugin. These "on the fly" compressors have been known to have issues with high traffic sites.

 

https://github.com/mrclay/minify

 

 

MINIFY WARNINGS

 

  • Minify is designed for efficiency, but, for very high traffic sites, it will probably serve files slower than your HTTPd due to the CGI overhead of PHP. See the FAQ and CookBook for more info.
     
  • If you combine a lot of CSS, watch out for IE's 4096 selectors-per-file limit, affects IE 6 through 9.
     
  • Minify should work fine with files encoded in UTF-8 or other 8-bit encodings like ISO 8859/Windows-1252. By default Minify appends ";charset=utf-8" to the Content-Type headers it sends.

Edited by japanisgreen, 18 April 2016 - 05:53 PM.


#3 apple82

apple82

    Member

  • Members
  • PipPipPipPip
  • 293 posts
  • LocationSpain

Posted 18 April 2016 - 04:48 PM

 

Sounds like your re-selling the FREE script minify....

 

https://github.com/mrclay/minify

 

 

MINIFY WARNINGS

 

  • Minify is designed for efficiency, but, for very high traffic sites, it will probably serve files slower than your HTTPd due to the CGI overhead of PHP. See the FAQ and CookBook for more info.
     
  • If you combine a lot of CSS, watch out for IE's 4096 selectors-per-file limit, affects IE 6 through 9.
     
  • Minify should work fine with files encoded in UTF-8 or other 8-bit encodings like ISO 8859/Windows-1252. By default Minify appends ";charset=utf-8" to the Content-Type headers it sends.

 

 

 

thanks so best not to use this system because they may have problems if there is a high% of visits to the web.



#4 japanisgreen

japanisgreen

    Junior Member

  • Members
  • PipPip
  • 41 posts

Posted 18 April 2016 - 05:43 PM

The AVS css/js files are static and never change so I so absolutely no point in changing them "on the fly" or paying money (for a otherwise free plugin which) can actually result in being slower than a traditional request.

 

You can simply combine them into a single file yourself for free with the following tools...

 

http://jscompress.com/

http://csscompressor.com/

 

This CSS compressor is nice because it allows you to adjust the level to minify.

 

You can save the combined files as something like style.min.css or jquery.avs.min.js and update the links in your header / footer.



#5 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 18 April 2016 - 06:17 PM

Streaming modules, Apache server, Nginx server are also free software, Why do you use it?

Software or tool can be free, but other case is how to use it properly.

 

Whatever, in case of my script it's not a script you mention, so most of your comments are false.

This is not a script which takes every js and css automatically. It's dedicated for AVS script and for selected javascript and css files only.

It's not working all the time, but mostly does the job once only. Later make use of simple cache.

This is nonsense to talk of slower performance. Minification main goal is to speed up read process.  Combining few files is to limit http requests. All major services does same. Files are not obfuscated, do not need any extra time to decode by browser.

 

You already make use of minified version of jquery, and bootstrap.js. Why not minify the rest? Why not combine it to limit http requests?

 

This is really nonsense to stand against something that such big giants like Cloudflare or Google do from years and suggest for webmasters.

What yo can find in general Google PageSpeed Insights suggestion?  Minify resources, optimize CSS delivery.

 

japanisgreen

This is true that you can use any popular minifier for both, javascript and css.

The difference is that you must do it every time when you change something in single css or js file. Then you must either change template files to use new names for your old css/js, or remember to rename and backup original files.

My script doesn't change original CSS and JS. Still you can edit it in normal way and it will be minimized/combined only once per change.

I've seen one or two webmasters here who minimized their javascript files, now not able to edit it, cannot change code, cannot add something new.

Rest do not minimize or combine anything. More than 90% of webmasters here are not that smart to find the right tools or software and use it properly.

 

BTW, older IE versions has limit of 278kb and 4096 css selectors. This is far more from what AVS script use for combined version of css.

Also who cares about IE 6,7,8?  AVS layout already use tons of css rules that are not supported by such old browsers.


Edited by dargre, 18 April 2016 - 06:19 PM.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#6 japanisgreen

japanisgreen

    Junior Member

  • Members
  • PipPip
  • 41 posts

Posted 18 April 2016 - 07:06 PM

 

 

This is really nonsense to stand against something that such big giants like Cloudflare or Google do from years and suggest for webmasters.

 

Cloudflare does not use your server's resources to combine files. The free plugin you hijacked relies on using your own systems resources to process and combine the files which is why it's a well known problem with these types of plugins being slower than a traditional request on high traffic sites (particularly those that are already performing resource intensive functions like video conversion!). As the developers of Minify stated "it will probably serve files slower than your HTTPd due to the CGI overhead of PHP". In layman's terms that means that due to the cost of resources consumed by PHP and the speed in which CGI is able to interact with the HTTPd server to run such a plugin will likely end up serving them slower than serving them separately on high-traffic sites.

 

Certainly it IS a good idea to minify the files but no to do so in the fashion that you are presenting as it is more likely to have adverse effects. 


Edited by japanisgreen, 18 April 2016 - 09:21 PM.


#7 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 18 April 2016 - 09:49 PM

japanisgreen

 

You don't know what you  write about and I do not find further dicussion to be useful with you.

This was said several times that my script doesn't use php to serve minimized and combined files. Javascript remains pure javascript type file, css is pure css type file, it's not parsed through php. it doesn't use any resources, it's simple link to css or js file type.

I also do not understand why you are so impudent to say that I hijacked something if you didn't even see anything.

I have written most of code by hand myself, rest of code is available public free to use if someone knows how to use it.

This was already said taht I do not use github minify script, not even single line from it.

Even if use what's wrong in it?

If you find it wrong, don't use it. But then also don't use jquery, don't use bootstrap, don't use phpmailer, smarty engine, image class as this is not code written by AVS team. Go and tell them that they hijacked it. How stupid talking this is!


VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#8 japanisgreen

japanisgreen

    Junior Member

  • Members
  • PipPip
  • 41 posts

Posted 18 April 2016 - 10:08 PM

You clearly have no understanding of the GNU Licensing Agreement.

 

You cannot take a free open source script and resell it as an "AVS plugin" (which is what you are doing).

 

The GNU license grants you free use of an open source script if it's packaged as part of an application that you are selling (ie. AVS) as long as you are not specifically profiting from the open source script itself.



#9 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 18 April 2016 - 10:25 PM

I don't use github mrcla/minify github project code. Not even single line from it.

Even if I used it, I have full right to do it as a part of my project.

Seems you are deaf and highly malicious to keep your stupid accusation on something you haven't even seen.


VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#10 japanisgreen

japanisgreen

    Junior Member

  • Members
  • PipPip
  • 41 posts

Posted 19 April 2016 - 12:17 AM

it doesn't use any resources, it's simple link to css or js file type.

 

You cannot combine the files on the fly without the use of server side scripting so that is absolutely ridiculous statement that makes me think that you don't even have any idea how the plugin actually works which makes sense since you did not write it to being with.

 

All the minify plugins reference issues with high traffic. You are just simply ignorant and have no idea what your talking about.

 

SmartOptimizer

"SmartOptimizer increases cpu and memory usages. So it might cause problems for your server if you have a popular website with lots of visitors"

 

Minify

"It will probably server files slower than your HTTPd due to the CGI overhead of PHP"


Edited by japanisgreen, 19 April 2016 - 12:31 AM.


#11 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 20 April 2016 - 11:10 PM

You cannot combine the files on the fly without the use of server side scripting so that is absolutely ridiculous statement that makes me think that you don't even have any idea how the plugin actually works .

 

Yes I can. Because it's one time fast proccess, which takes milliseconds. It's not used later any more until javascript or css content modified.

If you say that some milliseconds php script which is executed only once takes so much resources, then you simply do not know what you talk about!

It's exactly same like it is with template files. Smarty library cache each template file (can also minimize it on the fly), and later outputs it for display from cache instead of computing it all the time. This works until you do not delete cached version of template or modify some larger part of template file.

Minimized and combined javascript and css file has no cache time limit. It will output as static js or css file and is not computed all the time. It's computed only once or once when you change something in real js or css file.

 

You really think that service like Cloudflare minimize js and css on each request? No, they take original css/js files, minimize it and store as cached static files. And that's what my script does as well.

 

If you do not understand it, there's no sense to talk here anymore.

This was explained several times in previous posts, seems you either missed it several times (!!!), or intentionally do not want to understand and accept you are wrong.


Edited by dargre, 21 April 2016 - 02:48 AM.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)