File-based templates and caching

5 | published by Aleksey Bobkov on Tuesday, January 04, 2011

Today, we're excited to announce some very cool news for you! We just completed and published two features that will improve your web development experience and website performance with LemonStand. Meet file-based templates and the caching API!

File-based templates

Since the beginning our customers were asking us to implement file-based templates support. While the browser based code editor is handy for certain things, alone it couldn't be as flexible and powerful as file-based templates are. Discussions on this subject were never ending on the forum, in Twitter and other places.

Today we are proudly introducing the much requested, native file-based template support for LemonStand!

File-based templates have many benefits, from the ability to use any of your favorite editors to using any version control system. LemonStand stores CMS files in a separate directory, which you should create manually on the server. The directory can be outside of the LemonStand installation directory, and thus be inaccessible directly from the Web. Please read the file-based templates feature documentation to learn details.

Caching API and CMS caching

Caching is another feature which the community was constantly asking us about. Improving website performance is an important and complicated task. And now LemonStand simplifies this process with a built-in caching API, which is already integrated into the CMS. The caching API can use different caching methods: file-based caching, APC caching and memcached caching. The file-based caching is the slowest, but it does not require any additional PHP modules and can be used on any web server. APC and memcached caching are faster, but require corresponding PHP modules. Memcached caching allows you to use multiple servers with automatic balancing.

If you are a developer, you can use the caching API in your modules to cache any type of data. If you're a website builder, you can speed up your website by using the caching features which are built into the CMS - partial and page caching. When you enable caching for a page or a partial, LemonStand just loads the content from the cache, if it is available, instead of executing expensive queries and calculations. CMS caching is smart enough to recache data when you update your catalog, CMS or blog content.

Compare performance of the Category page on Demo store running on my development Mac box, with and without APC caching enabled. The performance has been measured with the ApacheBench command-line tool. The test measured how many requests the website can handle during 30 seconds with 10 concurrent users.

Caching disabled

Complete requests: 150
Requests per second: 5.00

Caching enabled

Complete requests: 563
Requests per second: 18.74

As you can see, enabling caching makes this specific page about 4 times faster. For complex pages, especially if you output multiple products on a single page, or run expensive SQL queries, this ratio can be even higher.

Learn more about caching:

rss Subscribe to Blog Feed

rss Subscribe to Blog Comments Feed

Share LemonStand

Email Updates

Get occasional updates and exclusive offers.

@lemonstand