Server side caching for large websites

What is web application caching?

Server side cache is web based software component that allows saving and reading temporary information that takes a long time to compute.

Such technology is used to improve website speed:

  • During first request information is generated and stored to cache files.
  • During following requests data is simply loaded from website cache, bypassing computing.

To speed up dynamic website data caching mechanism must be equipped with some kind of destructor that would delete cache data when website has been changed; otherwise it would prevent latest information from being displayed.

Expiring cache

Such mechanism adds expiry date to cache file; cache is recalculated if sever date surpass cache date.

Expiring cache is very useful for web applications that contact 3rd party server to receive data that changes continuously.

Let's say we are building weather plugin that contacts weather server to get forecast for 7 days. It takes somewhere 0.5s to 3s to contact weather station, so if we would have an application that waits for weather data with each request our website would slow down to weather server response time.

By using expiring cache we have to contact weather server only once a day with first request, further requests are retrieved from website cache in less than 0.01s

Persistent cache

Persistent caching provides best performance for internal server computing. Functions that provide server side website update, also delete cache files so they are reloaded only if information is changed.

What do we store in web cache?

Cache engine is used to store a set of variables depending of what are the slow parts of the system. Let's say we need to display database table: we can cache database records (SQL cache) or whole HTML code (buffer cache) as a variable.

Caching database records

We can cache database records needed for our table, so that database server would be contacted only when database is changed.

Caching buffers

If we choose to store whole HTML code as a variable we might gain a bit of website speed but our table might lose flexibility if we need to display some dynamic content in one of the cells.

Buffer is very useful to display complex navigation menus as their computing requires more than one database call.

Caching technology in Smooth Step CMS

We took advantages of different caching technologies and implemented them to our content management system. It uses expiring cache to display weather forecasts, persistent cache for website and CMS output.

Database records and buffer arrays are both used to achieve best possible website performance. Caching technology allows us to develop large websites (might contain thousands of pages) that load fast.

02 May 2008 14:18:00 CET by SmoothStep

Comments

  • jhon from sweden
    Date: 12/31/2008 11:08:00 PM

    Great article about the web application caching so the users will take advantage from this...

Post a comment

Here you can share your thoughts with us by posting a question/comment. Your e-mail will not be shown to protect your privacy. Required fields are marked with *

Anti-spam protection

Related Web pages

Check other Smooth Step articles related to servers, speed and database.

Web hosting

We have tried many web hosting providers and got disappointed due to slow, frequently crashing servers and poor support.

Business website hosting services »

Real estate software

Benchmarks on our dedicated servers show that a large real estate website with 2500 properties, 3 languages, complex search and high end “related properties” and other plugins generates pages in 0.

SEO friendly real estate manager »

Database

We offer custom databases based on Smooth Step DB on our servers (includes monthly database backup).

Database management software »

E-mail software

Email application uses POP3 mail servers to receive emails, and SMTP servers to send them.

More about e-mail software »

Web development

Large database driven websites are based on two (sometimes even more if demand is high) web servers one of which is responsible for application tasks and the other one for database storage and manipulations.

Web application development »