memfs icon indicating copy to clipboard operation
memfs copied to clipboard

Is it possible to create temporary files for express to read?

Open verydanny opened this issue 6 years ago • 1 comments

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.

verydanny avatar Feb 15 '19 17:02 verydanny

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).

streamich avatar Feb 16 '19 20:02 streamich

Closing since this is an application architecture problem, rather than directly related to memfs.

G-Rath avatar Nov 03 '22 19:11 G-Rath