I am having trouble managing cache keys in my project.
Currently we use a define-at-wish strategy and uniqueness of keys are not guaranteed.
Every time some one want to cache a kind of object, a constant is defined in the module in a form like this:
BOOK_NOTE_KEY = "BKNT%d"
An BookNote
object's cache key is like BOOK_NOTE_KEY % note.id
.
I think this is not a good way, because cache keys are not manageable.
What strategy do you take in your projects?