Optimizing your LemonStand store

0 | published by Aleksey Bobkov on Thursday, January 06, 2011

In this post I would like to share some performance optimization techniques, which can help you to make your LemonStand-based websites more responsive. Some approaches described below are common for any website, and some are LemonStand-specific.

We have applied the listed approaches to our Demo store and now it works amazingly fast (please note that cache on the Demo resource expires once an hour). Also, the YSlow tool displays grade A for category pages, and Google Page Speed tool returns score 91/100 for the same pages.

Combine JavaScript and CSS resources

Resource combining is a relatively new feature of LemonStand. It allows you to combine and minify multiple JavaScript or CSS files into a single request. Less number of requests means faster page loading and less server load. The resource combining feature even supports remote resources, so you can bind jQuery library from Google Ajax API CDN if you want.

You can learn about the resource combining feature from this documentation article: Combining and minifying JavaScript and CSS files.

Use Expires cache-contol headers for static content

The Expires header in an HTTP response allows browsers and proxy server to cache static content efficiently, thus reducing the number of server requests and decreasing page load. A simple way to apply Expires headers is using the mod_expires Apache module. This module allows you to control the content expiration for specific file types by adding corresponding directives to the .htaccess file. You will learn detailed information in the module documentation.

Compress website output

Compressing output data before sending it to a browser saves traffic and speeds up page loading. The mod_deflate Apache module is a simple compression solution, which allows to configure the compression in the .htaccess file. The module documentation contains a usage example and detailed instructions.

Use PHP accelerators

Due to the stateless nature of PHP, a web server needs to load, compile and execute PHP source files on each page request. The source file compilation takes time and loads CPU. Fortunately, there are PHP accelerators which can cache compiled PHP files and speed up the website. Some known accelerators are: 

Efficiency of these accelerators are comparable, but APC demonstrated the best performance in our tests.

Cache pages and partials

The just released page and partial caching is a native LemonStand feature which allows you to boost store performance by caching partials or whole pages in files or server memory. Caching dramatically reduces page execution time, because it just loads content from cache instead of executing expensive SQL queries and executing any business logic. Please read the caching documentation article for details.

Upcoming features

In the future we are going to implement even more features to make LemonStand more scalable and responsive. Specifically, the planned features are: simplifying load balancing, which will allow you to run LemonStand on multiple servers, and CDN support for static files (website resources) and product images.

rss Subscribe to Blog Feed

rss Subscribe to Blog Comments Feed

Share LemonStand

Email Updates

Get occasional updates and exclusive offers.

@lemonstand