Using OPFS to MinimizeTraffic to Server

I have a use case to allow users to upload files, but want to minimize traffic to the server, so I learned how to use the new OPFS file storage method.

The benefits include:

  • Store files client-side until they need to be pushed to the server, e.g. frequent file edits
  • Persistent storage of files, with capacity well beyond the typical 5MB client-side storage limit
  • Store binary data
  • Permission prompts and security checks are not required to access files in the OPFS

One thing that really helped me sort things out was the OPFS Explorer browser plug-in, so that I could dynamically observe the OPFS private file space in the browser developer console during development.

If other users have a use case for OPFS, I can create a demo project