I have that setup with FluidNC but I wouldn’t recommend it for normal users. It’s just macros renaming files. However, to fit both index.html.gz files, you need to do a custom build to take advantage of an 8MB ESP32. It can be done with a 4MB one as well with a different special build.
That was the very start of my “WebUI Shenanigans”.