Start Updating cached messages

Updating cached messages

The best way to create fast map services is to cache them.

If a client loses its network connection, your app will continue functioning correctly.

Simultaneous updates made this way are atomic: either all updates succeed or all updates fail.

The simplest way to delete data is to call method on your Firebase database reference.

This method is triggered once when the listener is attached and again every time the data, including children, changes.

The event callback is passed a snapshot containing all data at that location, including child data.

If data is stored in multiple locations to scale better, you can update all instances of that data using data fan-out.

For example, a social blogging app might have a , such as how this example creates the new post in both locations.

When the server receives a request for a map, it's much quicker to return one of these cached images than to draw the map again.