diff --git a/src/internal/m365/collection/drive/collections.go b/src/internal/m365/collection/drive/collections.go index 6964774b8..b88de4aaa 100644 --- a/src/internal/m365/collection/drive/collections.go +++ b/src/internal/m365/collection/drive/collections.go @@ -471,7 +471,7 @@ func (c *Collections) addURLCacheToDriveCollections( driveID, prevDelta, urlCacheRefreshInterval, - c.handler.NewItemPager(driveID, "", api.DriveItemSelectDefault()), + c.handler.NewItemPager(driveID, "", api.DriveItemSelectURLCache()), errs) if err != nil { return err diff --git a/src/pkg/services/m365/api/config.go b/src/pkg/services/m365/api/config.go index 9e2247279..a4758db88 100644 --- a/src/pkg/services/m365/api/config.go +++ b/src/pkg/services/m365/api/config.go @@ -112,3 +112,14 @@ func DriveItemSelectDefault() []string { "malware", "shared") } + +// URL cache only needs a subset of default select fields. +// This improves memory usage for delta query operations done by URL cache. +func DriveItemSelectURLCache() []string { + return idAnd( + "content.downloadUrl", + "deleted", + "file", + "folder", + ) +}