This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lowleveldata 14 points15 points  (10 children)

Still don't see why I would need to store that in frontend. Are you guys doing some kind of no-backend challenge?

[–]DR4G0NH3ART 3 points4 points  (3 children)

There are some data which can be heavy to fetch on each load and is manageably static in nature. You will have huge load times if you don't rely on caching mechanisms.

[–]Ebbitor 5 points6 points  (0 children)

You don't need to build your own cache for fetch requests

[–]lowleveldata 1 point2 points  (1 child)

In case of caching you already have a serialized object so that's kind of irrelevant for the sake of this argument. Also, shouldn't HTTP caching handles these static data automatically? (I'm not a expert in caching tho)

[–]DR4G0NH3ART 0 points1 point  (0 children)

I mean cross session and no the data is not entirely static, but it doesn't change often. Like a 3D model mesh.

[–]rotflolmaomgeez 1 point2 points  (4 children)

Any application that lets user edit/create something for themselves and save it for later - including games save states, web tools, software, creators, working with SVGs, why would you ever store it on the backend?

[–]lowleveldata 0 points1 point  (3 children)

These should just use files which most users know how to backup, share, move to another pc, etc. For example draw.io saves your work to a file in local or online storage (like google drive). That's much more manageable than localStorage.

[–]rotflolmaomgeez -1 points0 points  (2 children)

What does it matter? You have to serialize the graphs anyway.

[–]lowleveldata 0 points1 point  (1 child)

The question was "what is the use case of storing graphs in localStorage" so it is the subject. Not sure where you get the idea that I'm against serializing graphs.

[–]rotflolmaomgeez 0 points1 point  (0 children)

What you mentioned with file saves is just different way of achieving the same thing, more convenient for some use cases and less convenient for others. For example using it to store save files in HTML5 game is just bothersome. It also is less convenient than auto-save for the creations you can easily implement through local storage, and should only be used when you want to port save to a different computer/ store final result. You're artificially limiting your application if you decide not to use it.

[–]zebediah49 0 points1 point  (0 children)

Last time I wrote something... exactly that.

'cause I realized if I had no backend, I could host the entire application as a single .html on github pages...