rails / cache_digests

MIT License
642 stars 47 forks source link

Question: Using read_multi when appropriate #49

Open r38y opened 11 years ago

r38y commented 11 years ago

Do you think there is much benefit to adding tracking of the keys and using read_multi if there are a lot?

I know the goal of this gem is that in the end you only have a few keys since changes propagate up. However, I'm using this on a site that is kind of hard to do that which results in a lot of cache reads. I'm mostly using this gem for the key change when the template is updated feature.

I'd be happy to investigate if you think it would be worth it.

dhh commented 11 years ago

This could definitely be handy. When encapsulating caches expire, you often have to read a lot of underlying caches. Very curious how you intend to solve this, though. ERb's a processed linearly. So you're going to have to make some sort of two pass solution where you keep track of cache misses and then go back and re-render. Kinda of science project, and may screw with things like progressive rendering, but give it a shot!

On Jun 2, 2013, at 12:08 AM, Randy Schmidt notifications@github.com wrote:

Do you think there is much benefit to adding tracking of the keys and using read_multi if there are a lot?

I know the goal of this gem is that in the end you only have a few keys since changes propagate up. However, I'm using this on a site that is kind of hard to do that which results in a lot of cache reads. I'm mostly using this gem for the key change when the template is updated feature.

I'd be happy to investigate if you think it would be worth it.

— Reply to this email directly or view it on GitHub.