Mercurial > hg > orthanc
annotate OrthancFramework/Sources/FileStorage/StorageCache.cpp @ 5420:d37dff2c0028 am-new-cache
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 13 Nov 2023 17:01:59 +0100 |
parents | 0ea402b4d901 |
children | c65e036d649b |
rev | line source |
---|---|
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
1 /** |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4906
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4906
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
7 * |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
12 * |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
17 * |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
19 * License along with this program. If not, see |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
21 **/ |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
22 |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
23 |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
24 #include "../PrecompiledHeaders.h" |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
25 #include "StorageCache.h" |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
26 |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
27 #include "../Compatibility.h" |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
28 #include "../Logging.h" |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
29 #include "../OrthancException.h" |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
30 |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
31 #include <boost/lexical_cast.hpp> |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
32 |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
33 |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
34 namespace Orthanc |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
35 { |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
36 static std::string GetCacheKeyFullFile(const std::string& uuid, |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
37 FileContentType contentType) |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
38 { |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
39 return uuid + ":" + boost::lexical_cast<std::string>(contentType) + ":1"; |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
40 } |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
41 |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
42 static std::string GetCacheKeyStartRange(const std::string& uuid, |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
43 FileContentType contentType) |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
44 { |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
45 return uuid + ":" + boost::lexical_cast<std::string>(contentType) + ":0"; |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
46 } |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
47 |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
48 void StorageCache::SetMaximumSize(size_t size) |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
49 { |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
50 cache_.SetMaximumSize(size); |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
51 } |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
52 |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
53 |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
54 void StorageCache::Invalidate(const std::string& uuid, |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
55 FileContentType contentType) |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
56 { |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
57 // invalidate both full file + start range file |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
58 const std::string keyFullFile = GetCacheKeyFullFile(uuid, contentType); |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
59 cache_.Invalidate(keyFullFile); |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
60 |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
61 const std::string keyPartialFile = GetCacheKeyStartRange(uuid, contentType); |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
62 cache_.Invalidate(keyPartialFile); |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
63 } |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
64 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
65 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
66 StorageCache::Accessor::Accessor(StorageCache& cache) |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
67 : MemoryStringCache::Accessor(cache.cache_) |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
68 { |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
69 } |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
70 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
71 void StorageCache::Accessor::Add(const std::string& uuid, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
72 FileContentType contentType, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
73 const std::string& value) |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
74 { |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
75 |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
76 std::string key = GetCacheKeyFullFile(uuid, contentType); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
77 MemoryStringCache::Accessor::Add(key, value); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
78 } |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
79 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
80 void StorageCache::Accessor::AddStartRange(const std::string& uuid, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
81 FileContentType contentType, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
82 const std::string& value) |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
83 { |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
84 const std::string key = GetCacheKeyStartRange(uuid, contentType); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
85 MemoryStringCache::Accessor::Add(key, value); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
86 } |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
87 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
88 void StorageCache::Accessor::Add(const std::string& uuid, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
89 FileContentType contentType, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
90 const void* buffer, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
91 size_t size) |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
92 { |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
93 const std::string key = GetCacheKeyFullFile(uuid, contentType); |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
94 MemoryStringCache::Accessor::Add(key, reinterpret_cast<const char*>(buffer), size); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
95 } |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
96 |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
97 bool StorageCache::Accessor::Fetch(std::string& value, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
98 const std::string& uuid, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
99 FileContentType contentType) |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
100 { |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
101 const std::string key = GetCacheKeyFullFile(uuid, contentType); |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
102 if (MemoryStringCache::Accessor::Fetch(value, key)) |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
103 { |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
104 LOG(INFO) << "Read attachment \"" << uuid << "\" with content type " |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
105 << boost::lexical_cast<std::string>(contentType) << " from cache"; |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
106 return true; |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
107 } |
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
108 else |
4792
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
109 { |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
110 return false; |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
111 } |
434843934307
Added a StorageCache in the StorageAccessor
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
112 } |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
113 |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
114 bool StorageCache::Accessor::FetchStartRange(std::string& value, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
115 const std::string& uuid, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
116 FileContentType contentType, |
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
117 uint64_t end /* exclusive */) |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
118 { |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
119 const std::string keyPartialFile = GetCacheKeyStartRange(uuid, contentType); |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
120 if (MemoryStringCache::Accessor::Fetch(value, keyPartialFile) && value.size() >= end) |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
121 { |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
122 if (value.size() > end) // the start range that has been cached is larger than the requested value |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
123 { |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
124 value.resize(end); |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
125 } |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
126 |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
127 LOG(INFO) << "Read start of attachment \"" << uuid << "\" with content type " |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
128 << boost::lexical_cast<std::string>(contentType) << " from cache"; |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
129 return true; |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
130 } |
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
131 |
5420
d37dff2c0028
Optimized the MemoryStringCache to prevent loading the same file multiple times if multiple users request the same file at the same time
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
132 return false; |
4906
f656fb878b50
reintroduced storage cache for StartRange files
Alain Mazy <am@osimis.io>
parents:
4900
diff
changeset
|
133 } |
4900
ea5f1c6ed07e
fix cache of storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
134 } |