Skip to content

Commit 588588c

Browse files
committed
Merge branch 'remove-PerRequestCacheManager' into develop
2 parents 25bc0a7 + 6402140 commit 588588c

File tree

163 files changed

+1285
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+1285
-1101
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Nop.Core.Configuration;
2+
3+
namespace Nop.Core.Caching
4+
{
5+
/// <summary>
6+
/// Caching settings
7+
/// </summary>
8+
public class CachingSettings : ISettings
9+
{
10+
/// <summary>
11+
/// Gets or sets the default cache time in minutes
12+
/// </summary>
13+
public int DefaultCacheTime { get; set; }
14+
15+
/// <summary>
16+
/// Gets or sets the short term cache time in minutes
17+
/// </summary>
18+
public int ShortTermCacheTime { get; set; }
19+
}
20+
}

src/Libraries/Nop.Core/Caching/ICacheManager.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/Libraries/Nop.Core/Caching/IStaticCacheManager.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ namespace Nop.Core.Caching
66
/// <summary>
77
/// Represents a manager for caching between HTTP requests (long term caching)
88
/// </summary>
9-
public interface IStaticCacheManager : ICacheManager
9+
public interface IStaticCacheManager : IDisposable
1010
{
11+
/// <summary>
12+
/// Get a cached item. If it's not in the cache yet, then load and cache it
13+
/// </summary>
14+
/// <typeparam name="T">Type of cached item</typeparam>
15+
/// <param name="key">Cache key</param>
16+
/// <param name="acquire">Function to load item if it's not in the cache yet</param>
17+
/// <returns>The cached value associated with the specified key</returns>
18+
T Get<T>(CacheKey key, Func<T> acquire);
19+
1120
/// <summary>
1221
/// Get a cached item. If it's not in the cache yet, then load and cache it
1322
/// </summary>
@@ -16,5 +25,36 @@ public interface IStaticCacheManager : ICacheManager
1625
/// <param name="acquire">Function to load item if it's not in the cache yet</param>
1726
/// <returns>The cached value associated with the specified key</returns>
1827
Task<T> GetAsync<T>(CacheKey key, Func<Task<T>> acquire);
28+
29+
/// <summary>
30+
/// Removes the value with the specified key from the cache
31+
/// </summary>
32+
/// <param name="key">Key of cached item</param>
33+
void Remove(CacheKey key);
34+
35+
/// <summary>
36+
/// Adds the specified key and object to the cache
37+
/// </summary>
38+
/// <param name="key">Key of cached item</param>
39+
/// <param name="data">Value for caching</param>
40+
void Set(CacheKey key, object data);
41+
42+
/// <summary>
43+
/// Gets a value indicating whether the value associated with the specified key is cached
44+
/// </summary>
45+
/// <param name="key">Key of cached item</param>
46+
/// <returns>True if item already is in cache; otherwise false</returns>
47+
bool IsSet(CacheKey key);
48+
49+
/// <summary>
50+
/// Removes items by key prefix
51+
/// </summary>
52+
/// <param name="prefix">String key prefix</param>
53+
void RemoveByPrefix(string prefix);
54+
55+
/// <summary>
56+
/// Clear all cache data
57+
/// </summary>
58+
void Clear();
1959
}
2060
}

src/Libraries/Nop.Core/Caching/PerRequestCacheManager.cs

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)