Hello, I'm looking for clarification on using cache_get/set. The normal rule of thumb seems to be a bit different than the docs: http://api.drupal.org/api/function/cache_set/7
Rule of thumb is that with cache you can lose your data at any moment.
Rule of thumb is that variable_get/set and custom tables if for persistent data.
No problem when the temporary data does not need to be shared with multiple users, but when the data does need shared, one needs to do custom tables, variable_get/set or cache_get/set (any other options?).
The API states, "CACHE_PERMANENT: Indicates that the item should never be removed unless explicitly told to using cache_clear_all() with a cache ID." The table column states "expire A Unix timestamp indicating when the cache entry should expire, or 0 for never." And unless your module implements hook_flush_caches(), the data will not be flushed when a user clicks "clear cache". I also see a handful of functions that call cache_clear_all() with the finer control of passing options. This seems to imply that a developer can have a bit more control over data loss than "any moment".
There are a few catches,
It looks like the core bins may or may not expire automatically regardless of CACHE_PERMANENT?