News for hackers. Stuff that matters.
Re:How key-based cache expiration works by Sujan on Sunday February 19, 2012 @09:12AM (#3609369)
Ok, so the first interesting part is that instead of caching the result of a database request we cache the complete rendered result. And the bigger rendered parts are just constructed by combining the smaller (also cached) parts, right?

How does the application learn which version an element is at right now? Don't you have to call the database to find out?

Re:How key-based cache expiration works by getsat on Sunday February 19, 2012 @04:43PM (#3610522)
If you're rendering an object, you've likely already fetched it from the DB. Rails models (by default) will have a created_at and updated_at datetime columns that are automatically set and updated for you, and you can use them for exactly what is shown in the article.
Re:How key-based cache expiration works by asmala on Sunday February 19, 2012 @11:15AM (#3609609)
Correct on all accounts. You will still need to query the database at least for the parent object being rendered. The time saved is shaved off from the rendering time.