TechHui

Hawaiʻi's Technology Community

How many of you compress your javascript and put it in the bottom of the page? I recently learned that you can optimize the speed of your page loads by putting links to external javascript files at the bottom of the page just inside the BODY tag.

I use the YUI Compressor for javascript files. I formerly used JSmin, but now I just use YUIC. What's your preference? If so, why?

Today I hacked a simple PHP script to recursively poll through a folder of javascript files organized within folders in my application and run them through YUIC and save them to a separate folder for publishing to the production server. With 391 files in 52 folders, this is a time saver! Previously I would call up the Windows cmd window and do them manually one-by-one as I needed. If anyone is interested in the code for the script, I'd be happy to share.

My next step is to automate preparing my application for deployment by writing a script to call IonCube to encrypt PHP files and call YUIC to minify both javascript and CSS files.

Views: 26

Sponsors

web design, web development, localization

© 2024   Created by Daniel Leuck.   Powered by

Badges  |  Report an Issue  |  Terms of Service