Hello guys,
Apparently I cannot post in the proper place, so I'll leave it here. The mods can after move it to the Tutorials place, if they decide it's worth it.
It's common knowledge that every KB of data saved in bandwith can do wonders for your users and your server. A fast loading web site is a must in a time when nobody has time to waste. It's good for business and it's good for you.
Two components in every web site are key in order to achieve this goal: Images and Scripts. Unfortunately it's very common to use bloated images and scripts without the proper compression and file treatment, so it's up to the web designer this task.
I use 3 programs to accomplish this using a command line for all the compressing and the results are really good. The programs are: JpegTran, PNGOut for the images and YUIcompressor for the JS and CSS files. Google them out if you want to find more information.
I tried to keep it as simple and convenient for the user as possible, so I put together 2 batch scripts that can be run when you right click your web site folder. It's integrated into the Windows registry so it looks very natural and handy. After that, each script will run through all your sub-directories and look for every file that it can work with.
STEPS
1 - Simply unzip the folder into your C:\ disk.
2 - You will then have 2 folders: "OptImages" and "OptScripts". Inside each one there is a REG file that you need to add to Windows in order to have the right click functionality.
3 - Done!
After that, just right click the folder where your web site is stored and choose to optimize the scripts or the images. Wait for the command prompt to finish it's thing and that's it. It really takes just a few seconds for the whole process.
In my tests, I simply used a Wordpress theme as example. Originally, the theme had a total size of 1.28 MB. After the optimization, it shrinked to 1.09MB, approximately a 15% reduction.
Keep in mind that this programs don't recompress the images, but re-organize the image headers without touching the image per se, so it's a lossless process. For the scripts, it's just a matter of eliminating empty spaces, comments and reorganizing the code.
I hope you all like it. Enjoy!
Cheers,
Arky