Tuesday, February 26, 2008

Caching data

If we are looking for ways to improve our website performance, the cache is the key.

There are many ways to do this, the most common cache is full pages, but sometimes this is not possible. In these cases, the main thing is to locate the slowest processes and try to save their outcome. To that end, the best thing is to use memcache that allows us to keep one variable (serialized, as a string) and recover very quickly.

A more generic solution can be implemented in a class that receives data to store, allowing change the way of doing (memcache, database, files), if necessary to migrate the code to a server that does not have the necessary technology.

No comments: