AJAX-Tips Tutorials
AJAX-TipsOptimizing Files for Ajax
Optimizing files for Ajax is essential for building an Ajax based application. Every developer wants to their online application to be accessible to as many users as possible. By building a lightweight application, they ensure that any user – whether they are running with the highest bandwidth possible or just through dial up, could easily access their Ajax based website.
Although websites could still run and be light without the file optimization, the interactivity and the aesthetic beauty of the website is just not there since so many things are sacrificed just to build an interactive and fully functional website. But with optimization, sacrificing user interaction for the sake of access will never happen.
There are three types of files that could be optimized in an Ajax based application: CSS, JavaScript and Picture Files.
CSS and JavaScript could be treated as one since they are files that contain codes for building an Ajax based application. There are two stages in optimizing CSS and JavaScript.
The first stage is to “minify” CSS and JavaScript. This could be done by compressing the codes so that they could be light as possible. The good news is; you do not need a very powerful compressor just to “minify” your CSS and JavaScript. You do not even have to spend more than $0 either. Yahoo has provided developers with a free compressor – it is a lightweight compressor that is simple enough to be used. It is not recommended to use advanced compression tools as it will just complicate things and your code will be messier than ever.
After compression, you can combine the “minified” CSS and JavaScript. Combining the files are actually writing them in the application but instead of writing them, you just lay out the compressed files so that it could be read one by one according to its function. Remember that you have to place the files in order so that the function and eventually the website will work well. During run time of the application these files should be combined as well. This is the common mistake of developers who compress their files since it is possible that these could be read at the same time because they have become lightweight.
Picture files on the other hand are really easy for an Ajax based application. Instead of resizing your files for an efficient Ajax based application, you can run the files in the following applications. These are also free to download and could give your files a transformation it needs. It will lessen the footprint of your files without sacrificing the looks.
1. PngCrush – a simple PNG optimizer that ultimately creates a file that is immune to different types of bugs, especially the “double free” bug.
2. PngOptimizer – as the name suggests, this application will ensure that your files will be cleaned out of the unnecessary information and you’ll end up with raw photo. This application could also convert files into different image format.
Optimizing your files is really easy especially when you have the right tools. You do not need to spend thousands of dollars just to make sure you can build a lightweight Ajax based application.
Sponsored Links
