A
A
amikolyk2016-05-09 13:01:13
PHP
amikolyk, 2016-05-09 13:01:13

Which php cache to choose (implementation of global variables /data/)?

The task
is to store data in memory for quick access to them.
The data is calculated in a background script and added to memory. that data is prepared by only one script, all the rest only use it.
I tried XCache, but after an hour the script weighs more than 500 mb (the data itself is not more than 50 mb), plus if you run the script in the background through cron, the cached data is not visible to other scripts. Now everything works on files, but it's not very good.
What cache to use for such a task.
>>data are arrays of quotes + calculated indicators (calculating them every time is very costly).
>>Choose Memcached, but also installed Redis and wrote classes for both. Changing the cache is done simply in the settings cache='Redis' or cache='Memcached'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Osher, 2016-05-09
@amikolyk

Redis.

Антон Шаманов, 2016-05-09
@SilenceOfWinter

Вообще лучше более развернуто описать предметную область - что за данные, как используются. Может имеет смысл сделать многоуровневый кеш - данные\сгенерированные html блоки (например, последние новости)\браузерный кеш.
Нативное кеширование по определению быстрее других вариантов.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question