Modify the db caching so that all callbacks are invoked even if only one request is sent to the server.

Issue: #333