Configure Caching in Apache and IIS 8 Part 3 – Minify and Compress

By | August 5, 2017

File minimization and image compression reduces bandwidth use

This article on improving web application performance hosted on Apache and IIS web servers is the final of 3 on this subject. While part 1 and part 2 focused mostly on the caching capabilities of those two servers this one will focus on two simple techniques you can apply to your web application with minimum changes to the code but with reasonable results on the application loading both on desktop and mobile devices.

Before you start any of these optimizations you probably want to test the performance of your application so you can validate how much these techniques have helped to improve it. For that you can use Google’s PageSpeed Insights tool you’ll find in the Webmaster Tools.

File compression

QualTech .Net Custom Development Services | QualTech360DotNetThere are two ways to achieving file compression:

  • server side compression
  • file image compression

In this case we are going to discuss the file image compression which you can achieve on the application side instead of doing system configuration on the web server side. Then again maybe you are just hosting a WordPress blog hosted on an ISP and you really don’t have access to the web server anyway.

If you are hosting a Windows .Net application or even an application that is mostly html and javascript and you are using Visual Studio as the IDE to make the code changes and test the application you can install an extension which will allow you to optimize the size of your image files.

In Visual Studio go to Tools>Extensions and Updates. Select Online on the left pane and in the search located on the top right hand corner type Image Optimizer.

The installation might not start until you close Visual Studio or the installation will ask you to re-start after it completes. Just follow the instructions.

To compress your image files open your web application project, right click the folder containing the images for the application, select the Image Optimizer and select the type of optimization you QualTech Java Custom Development Services | QualTech360Javawant for the files, lossless or lossy.

If you are Java developer or use Netbeans or Elipse as your preferred development IDE I haven’t been able to find plugins that perform a similar function for Netbeans but I found OptiPNG for Eclipse. If you know of any similar plugins for Netbeans please leave your comments on this article it will be welcome.

If you are running a WordPress blog you have available plugins that perform image optimization such as WP Smush.

File minification

File minification is another technique you can use to help adding some additional performance improvement to your web site. This technique is applied usually to css, javascript and mostly static content html files.

File minification is not the same as file compression. The content of css, javascript and html files is text so minification simply explained removes spaces and unnecessary formatting characters from QualTech Software Development Services | QualTech360Developmentthe files making them smaller and therefore reducing the time it takes to load them in the browser. In addition javascript can also be loaded asynchronously causing the file to be loaded in the background allowing the browser to continue loading and transforming the remaining content without waiting until the file loading completes.

If you use Visual Studio as your development IDE you can install the extension Bundler & Minifier which will allow you to minify javascrit, css and html files. For Netbeans you can install the JS CSS Minify Compress plugin and for Elipse you can chose between YUICompressor, JSMin and JSCompressor.

If you run WordPress you can install a plugin like Autoptimize.

Don’t forget to run Google’s PageSpeed tests after you complete all your changes to verify the additional performance improvements you might have achieved.

I hope you find this article helpful, leave your comments.

#QualTech360Care, #QualTech360Development, #QualTech360Solutions, #QualTech360Java, #QualTech360DotNet

Leave a Reply