MV Manual File Caching/Preloading?

So I'm making a pretty unorthodox game admittedly... I have a few scenes in my game which uses a lot - I mean a lot - of images (and also few musics) that I essentially want to preload en masse... As just loading the pictures and music normally leads to the image being blank for a few frames when first using, and music not starting immediately when called, which makes the scene glitchy and kinda slow.
I was able to fix this using Chaucer's Scene Stabilizer by putting these image and music files into the so called "permanent assets", and it works super well for the scene, no image blanking or audio stuttering. But for literally everything else, it causes a little bit of lag, since it's holding all that stuff in the cache permanently, which isn't good. It's probably not wise to hold that stuff in permanent caching for the entire game's lifespan, so while Scene Stabilizer is pretty good at solving the problem, obviously it's not the perfect solution, I just need it for that one scene.

Here's what I'm looking for... I want to manually pick some Pictures and BGM files, and put them into a sort of "persistent cache?", which will be like the permanent caching from Chaucer's Scene Stabilizer, but a different script call can allow it to be let go.
There are a number of preloader plugins, if you're comfortable with your ability to manage them via commands.
I'm sure I can handle that...
My main worry is that despite me preloading something, the file won't stick around in the cache due to other things potentially loading in. I want it to stay until I clear it out myself with a command.

I'll look around and see if I can find a preloader that allows for script calls or plugin command usage, if you know any good examples, feel free to let me know. A lot of preload plugins I'm finding seem to use more automatic usages such as "on map load" or "on boot scene"... And so far, none of them mention about clearing the file(s) when you're done with them, which suggest to me that they don't make any effort to hold onto that file, and just let automatic garbage collection or whatever uncontrollable method clear them out.
Then again, I'm probably just not looking hard enough. I don't know all the websites people upload RPG MV plugins.
So first of all, the automatic garbage collection is running all the time for anything flagged as not used.
In MV the garbage collector is actually a little bit on the aggressive side, imo. I believe this is likely done because the engine was intended to port games to mobile devices, especially mobile devices of 2015 which had less Ram to work with.
You can go to the PIXI.js file and change your GC, but I don't recommend it.

One thing I have done for my game is that I have a buffer common event.
This basically rapidly "displays" all of the images I need at a 0 opacity value.
Immediately after running the buffer common event, I use the images as intended in the scene.
I am not certain of your use case as to whether this is feasible or not. You might need to elaborate on how you are using these items.

I also think I recall someone sharing a script for MZ that allows you to add or remove items from the cache manually. This script might exist for MV as well, maybe :LZSskeptic: Take a look:
One thing I have done for my game is that I have a buffer common event.
This basically rapidly "displays" all of the images I need at a 0 opacity value.
Immediately after running the buffer common event, I use the images as intended in the scene.
I am not certain of your use case as to whether this is feasible or not. You might need to elaborate on how you are using these items.

I also think I recall someone sharing a script for MZ that allows you to add or remove items from the cache manually. This script might exist for MV as well, maybe :LZSskeptic: Take a look:
Thanks for the advice. Having picture 99 displaying all the images at 0 opacity (and for good measure, offset so far away as to be offscreen) in the background during the scene seems to work well! Guess I don't need a plugin or script call for the images with this.

That just leaves the bgm.
I have a set up where I'm trying to play 5 bgms at the same time using an array of buffers for a dynamic music system with layers that mute and unmute due to conditions like low health or statuses, but because of the start delay, they were out of sync, and I couldn't figure out how to sync them up. I tried playing all layers on mute then stopping and starting unmuted, but for some odd reason, it still didn't work.

I looked at that script list you showed, but could only find checking and clearing cache, not adding.
There's not a lot of talk about bgm caching out there, so I wondered if it's possible, but the Scene Stabilizer Plugin allows me to put it into permanent assets and it works...
Any ideas for caching multiple BGM properly? I'll keep looking, but for now, it doesn't seem like holding BGM in the permanent cache is causing any immediate lag or problems.

Edit: Nevermind, I needed a full three second delay before restarting the music for it to work. Not ideal but it works.
We can close this thread. I got working solutions.

Original thread: https://forums.rpgmakerweb.com/threads/manual-file-caching-preloading.165126/