as I recall there is a size limit when using Preference lib, so suggest you only use that for things like ssid and passwords. You can save your web pages in SPIFFS memory, try look here: https://randomnerdtutorials.com/esp32-vs-code-platformio-spiffs/