0

I am currently building a website with Angular(front) and .NET Core (back). The aim of the website is to display medias on remote screens. These screens have my website opened and is already able to get the medias but I don't know how to store them properly on the client (as the medias can't disappear if the screen loses connection). I already tried using local storage but it has a pretty low size limit. I was then wondering : is there a way to do it properly via a web page or would it be better to make an app for the screens that would have admin rights?

Thanks in advance,

2 Answers2

0

I'd recommend taking a look at IndexedDb for storing large objects. It supports most of the browser https://caniuse.com/#feat=indexeddb

Also here is a good thread localStorage store large size data

svoychik
  • 1,188
  • 1
  • 8
  • 19
0

I'd recommend you to use either IndexedDb or Web Storage API along side with service workers (Client side storages. Recently, I found that service workers use Cache Storage in order to store static files such as images, fonts, etc., and also, dynamic resources like external APIs data. You can find PWA documentation here to see how you can configure the service worker.

cacheConfig in DataGroup section is where we can set cache config for external resources:

export interface DataGroup {
  name: string;
  urls: string[];
  version?: number;
  cacheConfig: { // <= here
    maxSize: number;
    maxAge: string;
    timeout?: string;
    strategy?: 'freshness' | 'performance';
  };
  cacheQueryOptions?: {
    ignoreSearch?: boolean;
  };
}