copy default settings for Local and Shared variables from C:\your engine path\Engine\Config\BaseEngine.ini
under section [InstalledDerivedDataBackendGraph] for launcher build OR [DerivedDataBackendGraph] for source build
add it to your DefaultEngine.ini under same section then change/add : DeleteUnused=false or if you want change it in base config
so in DefaultEngine.ini those should look like :
; ...
[InstalledDerivedDataBackendGraph]
Local=(Type=FileSystem, DeleteUnused=false , PurgeTransient=true, UnusedFileAge=34, Path="%ENGINEVERSIONAGNOSTICUSERDIR%DerivedDataCache", EnvPathOverride=UE-LocalDataCachePath, EditorOverrideSetting=LocalDerivedDataCache)
Shared=(Type=FileSystem, DeleteUnused=false , UnusedFileAge=10, FoldersToClean=10, ConsiderSlowAt=70, Path=?EpicDDC, EnvPathOverride=UE-SharedDataCachePath, EditorOverrideSetting=SharedDerivedDataCache, CommandLineOverride=SharedDataCachePath)