matomo-org/matomo

Redis cache: Prepend Matomo version number to cache key, and enforce a TTL

开放

#14,314 创建于 2019年4月4日

 (3 条评论) (0 个反应) (0 位负责人)PHP (2,894 个派生)batch import
BugHelp wanted

仓库指标

星标
 (21,803 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

In https://matomo.org/faq/how-to/faq_20511/ we recommend to use the Redis cache when using multiple servers to run Matomo. This can result in many issues though eg when each server has a different path to the Matomo directory.

Also when updating Matomo on the servers, in most cases some servers will run a new Matomo version while other servers will run an older version of Matomo. Yet they all access the same cache. This is problematic because caches aren't compatible between Matomo versions, and they have different files etc. Meaning while deploying code (in for us takes sometimes 30min+ to update all servers) Matomo can be broken if someone uses redis cache. To workaround this issue we could prepend the Matomo version number to all cache IDs. To still invalidate the cache entries of older Matomo versions, we need to make sure that when a cache is saved with no TTL, we need to set eg 86400 to free space after a while.

I will mention in the FAQ that redis cache can only be used if they all have the same path.

贡献者指南