When I first started coding PHP websites, I was using Emacs on a Linux computer. Then I switched to UltraEdit on Windows. I had a Linux server on the local network running Apache with PHP and MySQL. My projects were on the server and I was accessing the files through Samba. When developing locally, I switched my hosts file in order to point my website’s hostname to my local server instead of the production one. I was using FTP to put files online. Today I’m using a much more evolved approach as the following describes…
Monthly Archives: December 2009
Minimizing Javascript and CSS in Eclipse
Websites need to load as quickly as possible. The results of Internet connections being faster and faster is that we can’t stand anymore waiting for a page to load. We’re used to speed and if the page doesn’t load, I’ll just close the tab and go somewhere else.
Minimizing is the process of reducing the size of CSS and JavaScript files by compressing it. This is achieved by removing unnecessary white spaces and newlines and also by renaming JavaScript variables to something shorter. With this technique I’ve managed to reduce the size of some JS files by 50%. Yahoo! provides a wonderful tool called YUICompressor that does the job for you.
I’ve been looking for a way to automatically minimize JS and CSS files upon save in Eclipse in my PHP projects… finally found out how to do it!