You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Put `<add name="HybridCache" />` in the `<resizer><plugins>` section of `Web.config`
35
-
* Put `<hybridCache cacheLocation="C:\imageresizercache\" cacheMaxSizeBytes="1,000,000,000" />` in the `<resizer>` section of `Web.config`. If you want to use a temp folder, omit cacheLocation.
35
+
* Put `<hybridCache cacheLocation="C:\imageresizercache\" cacheSizeMb="1,000" />` in the `<resizer>` section of `Web.config`. If you want to use a temp folder, omit cacheLocation.
36
36
* HybridCache requires a cache folder outside of the web root. DiskCache did not support that.
37
37
* HybridCache, unlike DiskCache, can precisely limit the cache size & disk utilization.
38
38
* HybridCache uses a write-ahead log to prevent orphaned cache entries.
@@ -282,13 +281,17 @@ public IEnumerable<IIssue> GetIssues() {
282
281
"Please give user "+GetExecutingUser()+" read and write access to directory \""+DiskCacheDirectory+"\" to correct the problem. You can access NTFS security settings by right-clicking the aforementioned folder and choosing Properties, then Security.",IssueSeverity.ConfigurationError));
283
282
284
283
//Warn user about setting hashModifiedDate=false in a web garden.
285
-
if(_cacheOptions.MinCleanupBytes<1000*1000)
286
-
issues.Add(newIssue("HybridCache","minCleanupBytes should not be set below 1 megabyte (1,000,000). Found in the <hybridCache /> element in Web.config.",
284
+
if(_cacheOptions.EvictionSweepSizeMb<1)
285
+
issues.Add(newIssue("HybridCache","evictionSweepSizeMb should not be set below 1 MB. Found in the <hybridCache /> element in Web.config.",
287
286
"Setting a value too low will waste energy and reduce performance",IssueSeverity.ConfigurationError));
issues.Add(newIssue("HybridCache","cacheMaxSizeBytes should not be set below 100 MiB, 1GiB is the suggested minimum . Found in the <hybridCache /> element in Web.config.",
288
+
if(_cacheOptions.CacheSizeMb<100)
289
+
issues.Add(newIssue("HybridCache","cacheSizeMb should not be set below 100 MiB, 1GB is the suggested minimum . Found in the <hybridCache /> element in Web.config.",
291
290
"Setting a value too low will increase latency, increase cache misses, waste energy and reduce server performance.",IssueSeverity.ConfigurationError));
291
+
292
+
if(_cacheOptions.WriteQueueMemoryMb<50)
293
+
issues.Add(newIssue("HybridCache","writeQueueMemoryMb should not be set below 50 MiB, 100Mib is the suggested minimum . Found in the <hybridCache /> element in Web.config.",
294
+
"Setting a value too low will increase latency by forcing images to be written to disk before HTTP responses are sent.",IssueSeverity.ConfigurationError));
292
295
293
296
if(conflictsExist)
294
297
issues.Add(newIssue("HybridCache","More than one instance of HybridCache has been created for the same directory, these instances will fight.",IssueSeverity.ConfigurationError));
@@ -304,9 +307,9 @@ public IEnumerable<IIssue> GetIssues() {
*`<hybridCache cacheLocation="C:\imageresizercache\"/>` defaults to a app-unique subfolder of the IIS user account's temp folder. Cannot be located in the project or a web-accessible folder.
25
-
*`<hybridCache cacheMaxSizeBytes=""1,000,000,000" />` is in bytes and cannot be set below 9MB (9,000,000) or no files will be cached. 1GiB is the suggested minimum.
25
+
*`<hybridCache cacheSizeMb="1,000" />` is in bytes and cannot be set below 9MB (9,000,000) or no files will be cached. 1GiB is the suggested minimum.
26
26
*`<hybridCache databaseShards="8" />` adjust the number of shards (and write ahead log groups) in the database. Delete the cache folder after changing this number. Don't change this number unless directed by support.
27
-
*`<hybridCache queueSizeLimitInBytes="100,000,000" />` limits how much RAM can be used by the asynchronous write queue before making requests wait for caching writing to complete. (HybridCache writes cache entries in the background to improve latency). 100MB is the default and suggested minimum.
28
-
*`<hybridCache.minCleanupBytes="1,000,000" />` determines the minimum amount of bytes to evict from the cache once a cleanup is triggered. 1MB is the default and suggested minimum.
27
+
*`<hybridCache writeQueueMemoryMb="100" />` limits how much RAM can be used by the asynchronous write queue before making requests wait for caching writing to complete. (HybridCache writes cache entries in the background to improve latency). 100MB is the default and suggested minimum.
28
+
*`<hybridCache.evictionSweepSizeMb="1" />` determines the minimum amount of bytes to evict from the cache once a cleanup is triggered. 1MB is the default and suggested minimum.
29
29
30
30
## Migrating from DiskCache or TinyCache
31
31
32
32
***Delete your `/imagecache/` folder (otherwise it will become publicly accessible!!!)** (Actually, if installed, HybridCache will kill the application with an error message to prevent that - for all we know you resize images of passwords and have directory listing enabled)
33
33
* Delete references to `DiskCache` and `TinyCache` from **both nuget.config and Web.config**
* Put `<add name="HybridCache" />` in the `<resizer><plugins>` section of `Web.config`
36
-
* Put `<hybridCache cacheLocation="C:\imageresizercache\" cacheMaxSizeBytes="1,000,000,000" />` in the `<resizer>` section of `Web.config`. If you want to use a temp folder, omit cacheLocation.
36
+
* Put `<hybridCache cacheLocation="C:\imageresizercache\" cacheSizeMb="1,000" />` in the `<resizer>` section of `Web.config`. If you want to use a temp folder, omit cacheLocation.
37
37
* HybridCache requires a cache folder outside of the web root. DiskCache did not support that.
38
38
* HybridCache, unlike DiskCache, can precisely limit the cache size & disk utilization.
39
39
* HybridCache uses a write-ahead log to prevent orphaned cache entries.
public System.TimeSpan MinAgeToDelete { get; set; }
14
-
public long MinCleanupBytes { get; set; }
15
-
public long QueueSizeLimitInBytes { get; set; }
15
+
public long WriteQueueMemoryMb { get; set; }
16
16
}
17
17
public class HybridCachePlugin : ImageResizer.Plugins.IAsyncTyrantCache, ImageResizer.Plugins.IPlugin, ImageResizer.Plugins.IPluginInfo, ImageResizer.Plugins.IPluginRequiresShutdown
0 commit comments