Anyone recommends an alternative to set_transient
that persists the data for the whole duration of the expiration even when object cache is enabled?
Example:
- List item
- Set a long-duration transient
set_transient('foo', 'bar', WEEK_IN_SECONDS);
- Site is using object cache, so this is saved in memory
- I don't know internals of Redis, but memory cache is cleared
for some reason:
- Redis rotates cache based on the eviction policy
- Server reboots
- O.S-level memory management frees up memory
- etc?
Now that transient expired before 1 week.
In a scenario such as this, how can I create a value that is able to persist for a longer period?