Database/Internal storage - Show always most up to date content


#1

Hi!

I’m building and app using ionic3+angular5 conected with a firebase real-time database.

I have a page where I need to retrieve some data from firebase and show it to the user. I was thinking to save the data in the internal storage of the device the first time that the page is opened, so if the user opens the page again I can retrieve the data from the device storage and avoid a http request, but then I have a problem, the data in the server can be updated and I always want to show in the app the most up to date content, so, what would be the best way to show to the user always the most up to date content but minimize the number of http calls? I know that I can sort it out calling the server and retrieve the data everytime that the user enters the page but I would like to avoid that.

Thanks!!