CacheOptions.cs 968 B

1234567891011121314151617181920212223242526272829303132
  1. using Microsoft.Extensions.Caching.Memory;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace FastReport.Web.Cache
  6. {
  7. public class CacheOptions
  8. {
  9. private const int DEFAULT_TIMER_MINUTES = 15;
  10. /// <summary>
  11. /// Use legacy WebReport cache instead of <see cref="Microsoft.Extensions.Caching.Memory.MemoryCache"/>.
  12. /// Default value: true
  13. /// </summary>
  14. public bool UseLegacyWebReportCache { get; set; } = true;
  15. //public bool UseDistributedCache { get; set; } = false;
  16. // ?
  17. //public bool UseCustomCache ??
  18. /// <summary>
  19. /// Reports' lifetime in cache.
  20. /// If report is not used the specified time and there is no references to the object, it will be deleted from cache.
  21. /// Default value: "15".
  22. /// </summary>
  23. public TimeSpan CacheDuration { get; set; } = TimeSpan.FromMinutes(DEFAULT_TIMER_MINUTES);
  24. }
  25. }