We're in the process of building a restfull backend in craft. We had sluggish response times due to the amount of queries done by craft on a an entry listing. Each entry had about 3 levels of nesting and a list of 9 entries tool 10-13 seconds to render.
I've worked around this by outputting the json using twig and its cache. Now I've noticed that craft uses mysql to cache its data. Due to the amount of queries to this backend we will probably run out of its auto incremental key space. This platform has over 2 million unique visitors a day. (I've seen it before and it will happen)
Now my question is can I override the twig cache subsystem? For example use Redis so I can proactively notify middleware and/or frontend that caches have been cleared, so these tiers can regenerate the cache while still serving stale cache? And/or is there an event available inside the cache system so I can trigger on that?
Thanks in advance