Is it possible to create temporary files for express to read?
The problem
Our app React state has grown cumbersome, 200kb in size. Even with encoded serving it's still 80kb which is still a burden for 3g devices.
The solution?
I realize a real solution would be only serving the state we need for a particular route, but due to the shoddy old architecture, it would require a complete rewrite of some things. I was wondering if it's possible to do something like this:
{/*
1. Somehow store state in memFs
2. Read it through jsx <script> tag
*/}
<script
type="application/javascript"
href={ linkToMemFSStateFile }
/>
The issue with an endpoint is that it needs to be a unique state for every user. I'm just pulling my hair out how to cut these 80kb of app state out because recently performance has been a big deal for my company, out of nowhere, when I've been previously stressing to revamp our route/state architecture so we don't have to do patches like this, but here we are.
Have considered GraphQL?
I'm not sure how this is related to memfs, you can just have a HTTP endpoint that serves your state (different per user, based on authentication).
Closing since this is an application architecture problem, rather than directly related to memfs.