# HG changeset patch # User Sebastien Jodogne # Date 1779207504 -7200 # Node ID 581eb569f39a884a72d14425bc07ea1a03ed3b90 # Parent f29bf471d4a54017a32667ff15984e4d4d384c25 removed ServerContext::dicomCache_ diff -r f29bf471d4a5 -r 581eb569f39a OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Tue May 19 18:11:31 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Tue May 19 18:18:24 2026 +0200 @@ -361,10 +361,14 @@ void ServerContext::PublishCacheMetrics() { - metricsRegistry_->SetFloatValue("orthanc_dicom_cache_size_mb", - static_cast(dicomCache_.GetCurrentSize()) / static_cast(1024 * 1024)); - metricsRegistry_->SetIntegerValue("orthanc_dicom_cache_count", - static_cast(dicomCache_.GetNumberOfItems())); + // TODO-Streaming + + //metricsRegistry_->SetFloatValue("orthanc_dicom_cache_size_mb", + //static_cast(dicomCache_.GetCurrentSize()) / static_cast(1024 * 1024)); + //metricsRegistry_->SetIntegerValue("orthanc_dicom_cache_count", + //static_cast(dicomCache_.GetNumberOfItems())); + + metricsRegistry_->SetFloatValue("orthanc_storage_cache_size_mb", static_cast(storageCache_.GetCurrentSize()) / static_cast(1024 * 1024)); metricsRegistry_->SetIntegerValue("orthanc_storage_cache_count", @@ -382,7 +386,6 @@ compressionEnabled_(false), storeMD5_(true), largeDicomThrottler_(1), - dicomCache_(DICOM_CACHE_SIZE), mainLua_(*this), filterLua_(*this), luaListener_(*this), @@ -560,7 +563,7 @@ pool->Start(); storageAreaReader_.reset(new DataSourceReader(pool.release(), new StorageAreaDataSource(area_))); - storageAreaReader_->CreateCache(256 * 1024 * 1024); // 256 MB - TODO-Streaming - Parameter + storageAreaReader_->CreateCache(DICOM_CACHE_SIZE); // TODO-Streaming - Parameter } { @@ -823,12 +826,6 @@ return result; } - // Remove the file from the DicomCache - // If this is a new instance, this is a no-op - // If overwriteMode == OverwriteInstancesMode_IfChanged and the file has not changed, we won't reach this point - // If overwriteMode == OverwriteInstancesMode_Always, then, let's always invalidate even if it is meaningful only if the file has changed (note: there is a TODO about cache and MD5) - dicomCache_.Invalidate(resultPublicId); - // TODO Should we use "gzip" instead? CompressionType compression = (compressionEnabled_ ? CompressionType_ZlibWithSize : CompressionType_None); @@ -1615,24 +1612,12 @@ const std::string& uuid, ResourceType expectedType) { - if (expectedType == ResourceType_Instance) - { - // remove the file from the DicomCache - dicomCache_.Invalidate(uuid); - } - return index_.DeleteResource(remainingAncestor, uuid, expectedType); } void ServerContext::SignalChange(const ServerIndexChange& change) { - if (change.GetResourceType() == ResourceType_Instance && - change.GetChangeType() == ChangeType_Deleted) - { - dicomCache_.Invalidate(change.GetPublicId()); - } - pendingChanges_.Enqueue(change.Clone()); } diff -r f29bf471d4a5 -r 581eb569f39a OrthancServer/Sources/ServerContext.h --- a/OrthancServer/Sources/ServerContext.h Tue May 19 18:11:31 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.h Tue May 19 18:18:24 2026 +0200 @@ -33,7 +33,6 @@ #include "../../OrthancFramework/Sources/DataSource/DataSourceReader.h" #include "../../OrthancFramework/Sources/DataSource/DicomDataSource.h" #include "../../OrthancFramework/Sources/DicomParsing/DicomModification.h" -#include "../../OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h" #include "../../OrthancFramework/Sources/FileStorage/StorageAccessor.h" #include "../../OrthancFramework/Sources/FileStorage/StorageCache.h" #include "../../OrthancFramework/Sources/JobsEngine/JobsEngine.h" @@ -202,7 +201,6 @@ bool storeMD5_; Semaphore largeDicomThrottler_; // New in Orthanc 1.9.0 (notably for very large DICOM files in WSI) - ParsedDicomCache dicomCache_; LuaScripting mainLua_; LuaScripting filterLua_;