You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can give optional settings to the CachedRequest object.
76
88
77
-
***OneCallPerLocalStorage** - If true, the result will be returned from localstorage if it is not expired. *Default: false*
78
-
***OneCallPerSession** - If true, the result will be returned from sessionstorage if it is not expired. *Default: false*
79
-
***ExpireLocalStorage** - The DateTime the localstorage value will be expired. *Default: 7 days.*
80
-
***ExpireSessionStorage** - The DateTime the sessionstorage value will be expired. *Default: 15 minutes.*
81
-
***IgnoreCache** - If true, never return a cached result. *Default: false*
82
-
***CachedAndReplace** - If true, The cached result will be returned and the cache will be refreshed for the next call. *Default: false*
83
-
***CacheWhenOffline** - If true, the cached result will be returned when offline, except when IgnoreCache is true. *Default: false*
84
-
***RetryOnJsonException** - If true, If a JSON exception occurs, the cache will be cleared and the request will be retried once. This will minimize the effect if a breaking change was introduced in the JSON value. *Default: true*
| OneCallPerLocalStorage | If true, the result will be returned from localstorage if it is not expired. | false |
92
+
| OneCallPerSession | If true, the result will be returned from sessionstorage if it is not expired. | false |
93
+
| ExpireLocalStorage | The DateTime the localstorage value will be expired. | 7 days |
94
+
| ExpireSessionStorage | The DateTime the sessionstorage value will be expired. | 15 minutes |
95
+
| IgnoreCache | If true, never return a cached result. | false |
96
+
| CachedAndReplace | If true, The cached result will be returned and the cache will be refreshed for the next call. If no cache is found, the default or NULL value will be returned. | false |
97
+
| CacheWhenOffline | If true, the cached result will be returned when offline, except when IgnoreCache is true. | false |
98
+
| RetryOnJsonException | If true, If a JSON exception occurs, the cache will be cleared and the request will be retried once. This will minimize the effect if a breaking change was introduced in the JSON value. | true |
85
99
86
100
### Global settings
87
101
88
102
#### Postfix
103
+
89
104
On, for example, MainLayout.razor.cs, you can set the Postfix to be used for all requests. This is useful if you have multiple users using the same app from the same browser.
ExpireStorageService knows two properties to monitor if the app is offline.
95
111
96
112
IsOffline is true when the last request had an `HttpRequestException`, after a successful request IsOffline will be false.
@@ -105,7 +121,8 @@ ExpireStorageService can log to the console if you want to see what is happening
105
121
106
122
### ICacheableResponse
107
123
108
-
If a response object implements ICacheableResponse, the HandledBy property will be set to `HandledBy.Cache` if the result was retrieved from cache and to `HandledBy.Default` if the default provided by the caller was used.
124
+
If a response object implements ICacheableResponse, the HandledBy property will be set to `HandledBy.Cache` if the result was retrieved from cache and to `HandledBy.Default` if the default provided by
0 commit comments