using update + value
using update + value

if invalidate is true and update is true, the cache will be set to the "value" parameter.
Why? invalidate is expensive - a new database access must be done to get the new cache value.
If we already have the object instance, we don't need to invalidate it. We just set it in the "value" parameter, saving a database hit.
1stvamp/memorised,lindycoder/memorised