diff --git a/src/db/roomstore.ts b/src/db/roomstore.ts
index 303a11aa2d02da33b2f9777494c0342888960ec7..0e4d3652f5f5331654aec8563993838b0eea9675 100644
--- a/src/db/roomstore.ts
+++ b/src/db/roomstore.ts
@@ -175,7 +175,9 @@ export class DbRoomStore {
                 remote: remoteId ? new RemoteStoreRoom(remoteId, row as any) : null,
             });
         }
-        this.entriesMatrixIdCache.set(matrixId, {e: res, ts: Date.now()});
+        if (res.length > 0) {
+            this.entriesMatrixIdCache.set(matrixId, {e: res, ts: Date.now()});
+        }
         return res;
     }