How to clear audio cache? And to clear specific images from cache?

Searching a bit i found that i could clear the image cache using the "ImageManager.clear()" script. But it clears ALL images from cache what doesn't help me that much(I will have to load them again using a plugin after it, so that will consume lots of CPU and may end up crashing i think). Is there a way to clear specific images loaded?

Also, what about audio cache? Can i clear it? In this case, clearing all the cache would be enough.
.clear(), what it does, is simply redefine "cache" as a new empty variable, effectively erasing anything stored in it.
what you could potentially do is redefine the call, and add some parameters to it, so you could trigger a full wipe, or a specific audio/animation/image/whatever wipe.
you will need so sort the cache itself into groups, just so you can direct the wipe, but it's doable.

I believe you could maybe grab the "load_whatever" functions and introduce a middle step, which would store the name of that resource somewhere else.
when you would need to erase a specific type of resource, you'd call "wipe array of resources X", and it would iterate through the registered names, and clear those from the cache.
that's one way to do it.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-clear-audio-cache-and-to-clear-specific-images-from-cache.87390/