B
B
Bogdan Gerasimenko2017-04-16 12:06:59
Redis
Bogdan Gerasimenko, 2017-04-16 12:06:59

Do they use Redis and Memcached at the same time?

My hosting has two technologies Redis and Memcached. Judging by the description, both do the same thing, and can be used for Wordpress sites. Are they used at the same time or one at a time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tema_sun, 2017-04-16
@tema_sun

Redis can be used as an alternative to memcached, but it does more. You can also use them at the same time.
https://habrahabr.ru/company/oleg-bunin/blog/316652/

when an AJAX request arrives at our Ngnix frontend, Ngnix has a module that can work with memcached, i.e. we first request data in memcached by key, and if there is data (and JSON is stored there for our products), then we immediately return this JSON. It works very fast.
If there is no data, our request is proxied to PHP and there we have two situations - the product card can be in Redis, also in the form of JSON, then we take it from Redis, save it in memcached and give it further to the client.
If we have neither there nor there - neither in Redis, nor in memcached, we request our product card from MySQL, save it in Redis, duplicate this data in memcached and return it in the same way. With the following requests, our product cards are already issued directly from memcached.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question