Sometimes we may have a reason to use file-based transients instead of a default DB transients.
For example, most cache plugins automatically moves transients into external cache systems such as Redis, Memcached which might be a problem. Because if for some reason redis cache is reset – then all transients get lost – which is very bad for sure.
Transients are not always data which can easily be regenerated – sometimes they contain very important temporary data and should be kept until it expires.
That’s why W3Total Cache plugin has a great feature for it – you can keep a default transient storage(DB) while using Redis or other external object caching software.
For my own codes, sometimes i use filesystem based transient which i built for myself.
Here are set and get functions:
Continue reading “Filesystem based transient functions for WordPress”