WordPress Caching On Demand

There is no explicit mechanism for disk based caching. If you are writing a plugin or theme you intend to distribute you should be careful with allocating a folder for it, probably better to have some kind of an option for a user to configure that location. If this is something for a specific site, at least this should not be a problem, but you should probably use a directory which is not web public.

Of course, you should consider do you actually need to create such a thing. Unless you need to store a huge amount of data per “item” in the cache you are more likely to get a good enough results using an object cache plugin. You can store data directly with the wordpress caching api (wp_cache_get and family functions), or indirectly with transients, with the big advantage of not having to design something new yourself 😉