diff --git a/music_assistant/server/controllers/cache.py b/music_assistant/server/controllers/cache.py
index d0995c6b6..904c43ba9 100644
--- a/music_assistant/server/controllers/cache.py
+++ b/music_assistant/server/controllers/cache.py
@@ -68,24 +68,11 @@ async def get_config_entries(
                 label="Clear cache",
                 description="Reset/clear all items in the cache. ",
             ),
-            # ConfigEntry(
-            #     key=CONF_BIND_IP,
-            #     type=ConfigEntryType.STRING,
-            #     default_value=default_ip,
-            #     label="Bind to IP/interface",
-            #     description="Start the streamserver on this specific interface. \n"
-            #     "This IP address is communicated to players where to find this server. "
-            #     "Override the default in advanced scenarios, such as multi NIC configurations. \n"
-            #     "Make sure that this server can be reached "
-            #     "on the given IP and TCP port by players on the local network. \n"
-            #     "This is an advanced setting that should normally "
-            #     "not be adjusted in regular setups.",
-            #     advanced=True,
-            # ),
         )
 
     async def setup(self, config: CoreConfig) -> None:  # noqa: ARG002
         """Async initialize of cache module."""
+        self.logger.info("Initializing cache controller...")
         await self._setup_database()
         self.__schedule_cleanup_task()
 
@@ -154,18 +141,29 @@ async def delete(self, cache_key):
     async def clear(self, key_filter: str | None = None) -> None:
         """Clear all/partial items from cache."""
         self._mem_cache = {}
+        self.logger.info("Clearing database...")
         query = f"key LIKE '%{key_filter}%'" if key_filter else None
         await self.database.delete(DB_TABLE_CACHE, query=query)
+        await self.database.vacuum()
+        self.logger.info("Clearing database DONE")
 
     async def auto_cleanup(self):
         """Sceduled auto cleanup task."""
+        self.logger.info("Running automatic cleanup...")
         # for now we simply reset the memory cache
         self._mem_cache = {}
         cur_timestamp = int(time.time())
+        cleaned_records = 0
         for db_row in await self.database.get_rows(DB_TABLE_CACHE):
             # clean up db cache object only if expired
             if db_row["expires"] < cur_timestamp:
                 await self.delete(db_row["key"])
+                cleaned_records += 1
+        if cleaned_records > 50:
+            self.logger.debug("Compacting database...")
+            await self.database.vacuum()
+            self.logger.debug("Compacting database done")
+        self.logger.info("Automatic cleanup finished (cleaned up %s records)", cleaned_records)
 
     async def _setup_database(self):
         """Initialize database."""
@@ -202,8 +200,6 @@ async def _setup_database(self):
             DB_TABLE_SETTINGS,
             {"key": "version", "value": str(DB_SCHEMA_VERSION), "type": "str"},
         )
-        # compact db
-        await self.database.execute("VACUUM")
 
     async def __create_database_tables(self) -> None:
         """Create database table(s)."""
diff --git a/music_assistant/server/controllers/music.py b/music_assistant/server/controllers/music.py
index b1a2ecaac..8af013925 100755
--- a/music_assistant/server/controllers/music.py
+++ b/music_assistant/server/controllers/music.py
@@ -728,7 +728,9 @@ async def _setup_database(self):
         # create indexes if needed
         await self.__create_database_indexes()
         # compact db
-        await self.database.execute("VACUUM")
+        self.logger.debug("Compacting database...")
+        await self.database.vacuum()
+        self.logger.debug("Compacting database done")
 
     async def __create_database_tables(self) -> None:
         """Create database tables."""
diff --git a/music_assistant/server/helpers/database.py b/music_assistant/server/helpers/database.py
index 134b60f35..2d9cfb786 100755
--- a/music_assistant/server/helpers/database.py
+++ b/music_assistant/server/helpers/database.py
@@ -171,3 +171,8 @@ async def iter_items(
             if len(next_items) < limit:
                 break
             offset += limit
+
+    async def vacuum(self) -> None:
+        """Run vacuum command on database."""
+        await self._db.execute("VACUUM")
+        await self._db.commit()