HTTPCacheMaintananceParams.cs 996 B

123456789101112131415161718192021222324252627
  1. #if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace BestHTTP.Caching
  4. {
  5. public sealed class HTTPCacheMaintananceParams
  6. {
  7. /// <summary>
  8. /// Delete cache entries that accessed older then this value. If TimeSpan.FromSeconds(0) is used then all cache entries will be deleted. With TimeSpan.FromDays(2) entries that older then two days will be deleted.
  9. /// </summary>
  10. public TimeSpan DeleteOlder { get; private set; }
  11. /// <summary>
  12. /// If the cache is larger then the MaxCacheSize after the first maintanance step, then the maintanance job will forcedelete cache entries starting with the oldest last accessed one.
  13. /// </summary>
  14. public ulong MaxCacheSize { get; private set; }
  15. public HTTPCacheMaintananceParams(TimeSpan deleteOlder, ulong maxCacheSize)
  16. {
  17. this.DeleteOlder = deleteOlder;
  18. this.MaxCacheSize = maxCacheSize;
  19. }
  20. }
  21. }
  22. #endif