Some random thoughts:
There is a page size difference with arm/esp8266 - 256/4096 .
Can a closure compiler or similar be used to work out what is "constant" so that goes directly to flash?
You seem to be describing a write through cache. For rapidly changing vars, loops interators etc, these don't need to go flash at all.
@Wilberforce started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Some random thoughts:
There is a page size difference with arm/esp8266 - 256/4096 .
Can a closure compiler or similar be used to work out what is "constant" so that goes directly to flash?
You seem to be describing a write through cache. For rapidly changing vars, loops interators etc, these don't need to go flash at all.