Why to use memcached if Varnish is present Why to use memcached if Varnish is present nginx nginx

Why to use memcached if Varnish is present


Varnish + Memcached is a combination that makes perfect sense.

Normally, a web app has a guest and logged-in areas:

Varnish helps to completely bypass PHP engine execution by caching guest areas, allowing you to set high TTL there.Example: articles content that is shown to a guest user.

Memcached is to help with easing the burden on PHP engine when the request is not satisfied by Varnish cache, i.e. for logged-in user.Common things to store there include results of heavy SQL queries and other transient data that is costly to regenerate every time PHP runs.