You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

45 lines
2.0 KiB

  1. //
  2. // UniWebViewCacheMode.cs
  3. // Created by Wang Wei(@onevcat) on 2024-01-17.
  4. //
  5. // This file is a part of UniWebView Project (https://uniwebview.com)
  6. // By purchasing the asset, you are allowed to use this code in as many as projects
  7. // you want, only if you publish the final products under the name of the same account
  8. // used for the purchase.
  9. //
  10. // This asset and all corresponding files (such as source code) are provided on an
  11. // “as is” basis, without warranty of any kind, express of implied, including but not
  12. // limited to the warranties of merchantability, fitness for a particular purpose, and
  13. // noninfringement. In no event shall the authors or copyright holders be liable for any
  14. // claim, damages or other liability, whether in action of contract, tort or otherwise,
  15. // arising from, out of or in connection with the software or the use of other dealing in the software.
  16. /// <summary>
  17. /// Defines the cache mode for UniWebView.
  18. /// </summary>
  19. public enum UniWebViewCacheMode
  20. {
  21. /// <summary>
  22. /// Default mode. The web view will check the validity of the cache copy when there is one. If the copy is invalid,
  23. /// the web view will load from the network. This is the default setting.
  24. /// </summary>
  25. Default = 0,
  26. /// <summary>
  27. /// No cache is used. All pages are loaded directly from the network. This is useful for applications that do not
  28. /// want to have a cache.
  29. /// </summary>
  30. NoCache = 1,
  31. /// <summary>
  32. /// Prioritize the cache. If there is a copy of the page in the cache, the web view will use it even if the copy
  33. /// has expired. The web view will only load from the network when the page does not exist in the cache.
  34. /// </summary>
  35. CacheElseLoad = 2,
  36. /// <summary>
  37. /// Only use the cache. In this mode, the web view will not load pages from the network, only use the content in
  38. /// the cache. If the requested URL is not in the cache, an error is returned.
  39. /// </summary>
  40. CacheOnly = 3,
  41. }