Quantcast
Viewing latest article 10
Browse Latest Browse All 589

Is it okay to ask about the availability of LocalStorage in relation to IndexedDB

I have a burning question that, after much research, I can find no answer to. I desire to post this question on StackOverflow, but I am unsure whether it is on-topic.

My question is about JavasScript and concerns whether it is safe to assume that a user's browser has LocalStorage enabled and what to do if not. The question is not just for the current project at hand, rather it is also so that I can grow in my knowledge as a full-stack developer. Here is a preview of my question. The reason for why I give so much background is because I feel that it is necessary for a complete and thorough question, especially because people will be very curious about my use-case.

BACKGROUND: For an offline-ready collaborative big data PWA that I am designing, I need to be able to sync data between tabs so that if the user goes offline and multiple browser tabs are logged into the same account, then their data can synchronize in order to prevent user confusion/frustration and database corruption. As I am dealing with big data (data so big that loading it all into memory at once would cause serious lag or a crash), the data is being partially synced between the server and IndexedDB. For various reasons, indexedDB isn't suitable due to race conditions and Safari not supporting SharedWorkers—a panacea for this problem. So, I am using local storage to persistently synchronize between tabs for offline readiness.

Is it reasonable to assume that the majority of users accessing my website will have access to a LocalStorage capable of sustaining the concurrency necessary for my purposes, or what problems/conditions/circumstances should I know about? No, I am not asking you to post a link to the Can I Use page on LocalStorage and call it an answer. Rather, I am seeking the information that the Can I Use page does not tell you. For example, I already know that pages in sandboxed iframes are unable to access localStorage, but this particular note is not a problem for my purposes. I am also aware of the several-megabyte LocalStorage size limits, but I only store tiny data is stored in LocalStorage. Another note that I came across is that there are options in some browsers to disable LocalStorage, so I'll need to walk users through how to reenable it. What other notes should I know?


Viewing latest article 10
Browse Latest Browse All 589

Trending Articles