aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/BaseApiService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-03 23:04:19 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-03 23:04:19 -0500
commit351cfef7a70ef311801be0bc9eb9e3891265d22b (patch)
treeedb841c6b311a1c13c4c70cbd4ed08e9129fac78 /MediaBrowser.Api/BaseApiService.cs
parent48b9f657a4d163e4be32c1641907fc429481aa85 (diff)
use conditional caching on some json responses
Diffstat (limited to 'MediaBrowser.Api/BaseApiService.cs')
-rw-r--r--MediaBrowser.Api/BaseApiService.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 556f3b57d..2dd1c77e1 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -21,7 +21,7 @@ namespace MediaBrowser.Api
/// </summary>
/// <value>The logger.</value>
public ILogger Logger { get; set; }
-
+
/// <summary>
/// Gets or sets the HTTP result factory.
/// </summary>
@@ -58,16 +58,27 @@ namespace MediaBrowser.Api
/// <param name="cacheKey">The cache key.</param>
/// <param name="lastDateModified">The last date modified.</param>
/// <param name="cacheDuration">Duration of the cache.</param>
- /// <param name="factoryFn">The factory fn.</param>
+ /// <param name="factoryFn">The factory function.</param>
/// <returns>System.Object.</returns>
- /// <exception cref="System.ArgumentNullException">cacheKey</exception>
- protected object ToOptimizedResultUsingCache<T>(Guid cacheKey, DateTime lastDateModified, TimeSpan? cacheDuration, Func<T> factoryFn)
- where T : class
+ protected object ToOptimizedResultUsingCache<T>(Guid cacheKey, DateTime? lastDateModified, TimeSpan? cacheDuration, Func<T> factoryFn)
+ where T : class
{
return ResultFactory.GetOptimizedResultUsingCache(Request, cacheKey, lastDateModified, cacheDuration, factoryFn);
}
/// <summary>
+ /// To the optimized serialized result using cache.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="result">The result.</param>
+ /// <returns>System.Object.</returns>
+ protected object ToOptimizedSerializedResultUsingCache<T>(T result)
+ where T : class
+ {
+ return ResultFactory.GetOptimizedSerializedResultUsingCache(Request, result);
+ }
+
+ /// <summary>
/// To the cached result.
/// </summary>
/// <typeparam name="T"></typeparam>