Performance Tuning - Chapter 4: Server-side Optimization

This chapter provides two common ways for performance optimization on the server side.

1. Use compression function, enable GZip on the server

A very simple performance improvement that everybody should do is to enable GZip on the web server. With GZip, the web server compresses all text-based files on the fly, and the web browser will decompress them on the fly, and as a result the files get up to four times smaller, which reduces download time of course. This works with all modern web browsers.

2. Use a Content Distribution Network

Another way to battle latency is to bring the files closer to the end-user. Content Distribution Networks (CDNs) have many servers all over the world that cache static files close to the end-user. European users will load images and CSS files from Europe, while US visitors get them from the US. So our recommendation is to put images and CSS files on a CDN. The most well-known CDN vendors are Akamai and Mirror Image, both of which support complex setups; a simple and affordable solution is offered by Cachefly.

The build script can change the link to the CSS file to an absolute URL that points to the CDN (e.g. http://images.backbase.com). If the CSS has relative links to images, those images will be automatically loaded from the CDN, so make sure you copy them to the CDN. The build script can parse your XML files to change relative image links into absolute ones. Some of the Backbase bindings also contain image links, both regular image anchors as well as CSS images: for best results you might want to put those on the CDN, too.

With a simple CDN setup that uses a subdomain, it is not possible to put the Backbase files on the CDN, because of cross-domain issues. However, both Mirror Image and Akamai support a reverse proxy setup: your domain points to the CDN, and the CDN serves your entire website, with the exception of the dynamic files: the CDN pulls dynamic pages from your site and passes them through to the website visitor. The CDN uses the HTTP headers to distinguish between static and dynamic content. See the image below for an illustration:

image

Note: Static files are served by the nearest point-of-presence (POP) of the CDN, while dynamic requests are passed through to the origin server.

See other chapters:

Performance Tuning - Checklist

Performance Tuning - Chapter 1: Architecture and Design

Performance Tuning - Chapter 2: Implementation

Performance Tuning - Chapter 3: Deployment

Performance Tuning - Chapter 4: Server-side Optimization

Performance Tuning - Chapter 5: Testing

Performance Tuning - Chapter 6: Conclusion