Monday, March 12, 2012

What should you cache?

A good way of solving performance problems in an application is often to add caching at strategic layers of the application. But what should you cache?

For me, the single most important thing to cache is to everything that makes a network request.

Performing a network request will always have an overhead caused by the TCP/IP protocol, network latency, the network cards and the Ethernet cables. Even the slightest network hick up might cause huge performance issues in your application. A slow database will seriously decrease the performance of your application.

It is often not possible to cache everything that makes a network request, but not doing so should at least be a conscious decision and not just something you forgot to implement.

No comments:

Post a Comment