Fasten your seat belt! Enjoy cache in Osclass!

speed

What’s in Osclass version 3.4, that is new, awesome and will help you increase your response time up to 30%?  Yes, you’ve guessed it. It’s cache!
With this new Osclass version, you can now enjoy cache and get a faster page loadingincrease search engines’ ratings and enhance user’s experience, thus increasing the number of pageviews.

Note that this post is slightly technical, but we’ll try to unravel all the tech verbiage for you.

Osclass and cache
Osclass 3.4 now allows different types of cache (apc and memcache).

What is cache? How does it work?
A website contains content which is dynamically generated. When a user browse through your website, he or she is launching queries to the website database. Some database queries i.e. filtered searches are usually costly and recurrent operations, so why repeat the most common queries if we already know the results?

A cache, in web applications terms, stores files (objects, costly operations’ results,etc.) in order to lower the bandwidth, server loading and download delay.

As we’ve mentioned before, in your Osclass website there are certain costly operations, such as complex database queries. The result of these complex actions is stored in cache so the server doesn’t need to generate the data again. These data are returned from the cache instead of making a query to the database. This implies a drastic improvement in website loading and response time, allowing to support more visitors to your site.

Here’s a comparison of server response time on an Osclass website with thousands of listings, with and without cache.

Want to know how does cache affect an Osclass site? Check out this performance testing.

Cache consists of stored data/information which is available through a unique key which is associated to a value. Each key+value stored in the cache has a limited amount of seconds of “lifetime”. This lifetime defines the validity of the data.

Key + Value + Lifetime (seconds)

Let’s see an example:

  • The active category list is usually static so we’ll usually a longer lifetime. In this case, we can set a 7 days lifetime, for example.
  • The  latest listings list is usually more dynamic as we receive many new listings daily and want data to be updated frequently. For example, if we choose to set a 10 min lifetime to the latest listings list, this will be the frequency in which your listings will be updated.

Got any question? You can always consult our forums or drop a line to us.

This entry was posted in Development, Releases and tagged , , , , , , . Bookmark the permalink. Marta Bosch

One Response to Fasten your seat belt! Enjoy cache in Osclass!

  1. Andrew says:

    Hey guys how to install memchache. I use this:

    define(‘OSC_CACHE’, ‘memcache’);
    $_cache_config[] = array(
    ‘default_host’ => ‘pub-memcache-12006.eu-west-1-1.2.ec2.garantiadata.com’,
    ‘default_port’ => 12006,
    ‘default_weight’ => 1
    );

    but with no success (site still loads the same time)