Caching Dynamically Modified Objects and the Trouble it Causes
So I told you, in a previous post , about how our application has two parts: the live site and the cms. And that we want objects of the same class to behave differently in the two applications (only 'live' status objects should show up on the live site), which is not so hard in Ruby. But a few days later and after some conversations with our architect about how our caching works we realized that we had a huge bug. We use memcached and cache-fu to cache our objects and we share that cache between the cms and the live site for the simple reason that we want an update to the object in cms to blow away the cache for the live site (otherwise the live site would never see the change as it would constantly be referencing the old cached version). But, as you may have already guessed, if the live site gets an object cached from the cms then all sorts of 'draft' stuff will show up on the public site because an object built in the cms will not have the extra special dynamica...