How to programmatically check whether a particular cache type is enabled

See also: