You set memorysize to 0 to make Kodi cache the entire file your playing locally…
https://kodi.wiki/view/Advancedsettings.xml#cache
You can also bump the readfactor up a bit but I’d suggest not going to high as this can be problematic if your fully saturating your network connection. Saving everything your playing to disk massively increases wear on solid state memory (which is bad) so I would only do it if you are also adding in some storage medium you don’t care about and using that to store your temp folder. You can move where your temp folder is via path substitution which I’ve detailed here…