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
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-aspnet-output-cache-provider.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,30 +43,30 @@ The NuGet package downloads and adds the required assembly references and adds t
43
43
</caching>
44
44
```
45
45
46
-
Configure the attributes on the left with the values from your cache in the Microsoft Azure portal. Also, configure the other values you want. For instructions on accessing your cache properties, see [Configure Azure Cache for Redis settings](cache-configure.md#configure-azure-cache-for-redis-settings).
46
+
Configure the attributes in the first c with the values from your cache in the Microsoft Azure portal. Also, configure the other values you want. For instructions on accessing your cache properties, see [Configure Azure Cache for Redis settings](cache-configure.md#configure-azure-cache-for-redis-settings).
47
47
48
48
| Attribute | Type | Default | Description |
49
49
| --------- | ---- | ------- | ----------- |
50
50
|*host*| string | "localhost" | The Redis server IP address or host name |
51
51
|*port*| positive integer | 6379 (non-TLS/SSL)<br/>6380 (TLS/SSL) | Redis server port |
52
-
|*accessKey*| string | "" | Redis server password when Redis authorization is enabled. The value is an empty string by default, which means the session state provider won’t use any password when it connects to Redis server. **If your Redis server is in a publicly accessible network like Azure Cache for Redis, be sure to enable Redis authorization to improve security, and provide a secure password.**|
52
+
|*accessKey*| string | "" | Redis server password when Redis authorization is enabled. The value is an empty string by default, which means the session state provider doesn't use any password when it connects to Redis server. **If your Redis server is in a publicly accessible network like Azure Cache for Redis, be sure to enable Redis authorization to improve security, and provide a secure password.**|
53
53
|*ssl*| boolean |**false**| Whether to connect to Redis server via TLS. This value is **false** by default because Redis doesn’t support TLS by default. **If you're using Azure Cache for Redis, which supports SSL by default, be sure to set this value to true to improve security.**<br/><br/>The non-TLS port is disabled by default for new caches. Specify **true** for this setting to use the non-TLS port. For more information about enabling the non-TLS port, see the [Access Ports](cache-configure.md#access-ports) section in the [Configure a cache](cache-configure.md) article. |
54
54
|*databaseIdNumber*| positive integer | 0 |*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>Specify which Redis database to use. |
55
55
|*connectionTimeoutInMilliseconds*| positive integer | Provided by StackExchange.Redis | Used to set *ConnectTimeout* when creating StackExchange.Redis.ConnectionMultiplexer. |
56
56
|*operationTimeoutInMilliseconds*| positive integer | Provided by StackExchange.Redis | Used to set *SyncTimeout* when creating StackExchange.Redis.ConnectionMultiplexer. |
57
57
|*connectionString* (Valid StackExchange.Redis connection string) | string |*n/a*| Either a parameter reference to AppSettings or web.config, or else a valid StackExchange.Redis connection string. This attribute can provide values for *host*, *port*, *accessKey*, *ssl*, and other StackExchange.Redis attributes. For a closer look at *connectionString*, see [Setting connectionString](#setting-connectionstring) in the [Attribute notes](#attribute-notes) section. |
58
58
|*settingsClassName*<br/>*settingsMethodName*| string<br/>string |*n/a*|*These attributes can be specified only through either web.config or AppSettings.*<br/><br/>Use these attributes to provide a connection string. *settingsClassName* should be an assembly qualified class name that contains the method specified by *settingsMethodName*.<br/><br/>The method specified by *settingsMethodName* should be public, static, and void (accepting no parameters), with a return type of **string**. This method returns the actual connection string. |
59
59
|*loggingClassName*<br/>*loggingMethodName*| string<br/>string |*n/a*|*These attributes can be specified only through either web.config or AppSettings.*<br/><br/>Use these attributes to debug your application by providing logs from Session State/Output Cache along with logs from StackExchange.Redis. *loggingClassName* should be an assembly qualified class name that contains the method specified by *loggingMethodName*.<br/><br/>The method specified by *loggingMethodName* should be public, static, and void (accept no parameters), with a return type of **System.IO.TextWriter**. |
60
-
|*applicationName*| string | The module name of the current process or "/" |*SessionStateProvider only*<br/>*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>The app name prefix to use in Redis cache. The customer may use the same Redis cache for different purposes. To insure that the session keys don't collide, it can be prefixed with the application name. |
60
+
|*applicationName*| string | The module name of the current process or "/" |*SessionStateProvider only*<br/>*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>The app name prefix to use in Redis cache. The customer might use the same Redis cache for different purposes. To ensure that the session keys don't collide, it can be prefixed with the application name. |
61
61
|*throwOnError*| boolean | true |*SessionStateProvider only*<br/>*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>Whether to throw an exception when an error occurs.<br/><br/>For more about *throwOnError*, see [Notes on *throwOnError*](#notes-on-throwonerror) in the [Attribute notes](#attribute-notes) section. |
62
-
|*retryTimeoutInMilliseconds*| positive integer | 5000 |*SessionStateProvider only*<br/>*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>How long to retry when an operation fails. If this value is less than *operationTimeoutInMilliseconds*, the provider won't retry.<br/><br/>For more about *retryTimeoutInMilliseconds*, see [Notes on *retryTimeoutInMilliseconds*](#notes-on-retrytimeoutinmilliseconds) in the [Attribute notes](#attribute-notes) section. |
62
+
|*retryTimeoutInMilliseconds*| positive integer | 5000 |*SessionStateProvider only*<br/>*This attribute can be specified only through either web.config or AppSettings.*<br/><br/>How long to retry when an operation fails. If this value is less than *operationTimeoutInMilliseconds*, the provider doesn't retry.<br/><br/>For more about *retryTimeoutInMilliseconds*, see [Notes on *retryTimeoutInMilliseconds*](#notes-on-retrytimeoutinmilliseconds) in the [Attribute notes](#attribute-notes) section. |
63
63
|*redisSerializerType*| string |*n/a*| Specifies the assembly qualified type name of a class that implements Microsoft.Web.Redis. Serializer and that contains the custom logic to serialize and deserialize the values. For more information, see [About *redisSerializerType*](#about-redisserializertype) in the [Attribute notes](#attribute-notes) section. |
64
64
65
65
## Attribute notes
66
66
67
67
### Setting *connectionString*
68
68
69
-
The value of *connectionString* is used as key to fetch the actual connection string from AppSettings, if such a string exists in AppSettings. If not found inside AppSettings, the value of *connectionString*will be used as key to fetch actual connection string from the web.config **ConnectionString** section, if that section exists. If the connection string doesn't exist in AppSettings or the web.config **ConnectionString** section, the literal value of *connectionString*will be used as the connection string when creating StackExchange.Redis.ConnectionMultiplexer.
69
+
The value of *connectionString* is used as key to fetch the actual connection string from AppSettings, if such a string exists in AppSettings. If not found inside AppSettings, the value of *connectionString*is used as key to fetch actual connection string from the web.config **ConnectionString** section, if that section exists. If the connection string doesn't exist in AppSettings or the web.config **ConnectionString** section, the literal value of *connectionString*is used as the connection string when creating StackExchange.Redis.ConnectionMultiplexer.
70
70
71
71
The following examples illustrate how *connectionString* is used.
72
72
@@ -78,7 +78,7 @@ The following examples illustrate how *connectionString* is used.
78
78
</connectionStrings>
79
79
```
80
80
81
-
In `web.config`, use above key as parameter value instead of actual value.
81
+
In `web.config`, use the key as parameter value instead of actual value.
@@ -126,15 +126,15 @@ In `web.config`, use above key as parameter value instead of actual value.
126
126
127
127
Currently, if an error occurs during a session operation, the session state provider throws an exception. Throwing the exception shuts down the application.
128
128
129
-
This behavior has been modified in a way that supports the expectations of existing ASP.NET session state provider users while also allowing you to act on exceptions. The default behavior still throws an exception when an error occurs, consistent with other ASP.NET session state providers. Existing code should work the same as before.
129
+
This behavior was modified in a way that supports the expectations of existing ASP.NET session state provider users while also allowing you to act on exceptions. The default behavior still throws an exception when an error occurs, consistent with other ASP.NET session state providers. Existing code should work the same as before.
130
130
131
131
If you set *throwOnError* to **false**, then instead of throwing an exception when an error occurs, it fails silently. To see if there was an error and, if so, discover what the exception was, check the static property *Microsoft.Web.Redis.RedisSessionStateProvider.LastException*.
132
132
133
133
### Notes on *retryTimeoutInMilliseconds*
134
134
135
135
The *retryTimeoutInMilliseconds* setting provides some logic to simplify the case where a session operation should retry on failure because of a network glitch or something else. The *retryTimeoutInMilliseconds* setting also allows you to control the retry timeout or to completely opt out of retry.
136
136
137
-
If you set *retryTimeoutInMilliseconds* to a number, for example 2000, when a session operation fails, it retries for 2000 milliseconds before treating it as an error. To have the session state provider apply this retry logic, just configure the timeout. The first retry will happen after 20 milliseconds, which is sufficient in most cases when a network glitch happens. After that, it will retry every second until it times out. Right after the time-out, it will retry one more time to make sure that it won’t cut off the timeout by (at most) one second.
137
+
If you set *retryTimeoutInMilliseconds* to a number, for example 2000, when a session operation fails, it retries for 2,000 milliseconds before treating it as an error. To have the session state provider apply this retry logic, just configure the timeout. The first retry will happen after 20 milliseconds, which is sufficient in most cases when a network glitch happens. After that, it will retry every second until it times out. Right after the time-out, it will retry one more time to make sure that it won’t cut off the timeout by (at most) one second.
138
138
139
139
If you don’t think you need retry or if you want to handle the retry logic yourself, set *retryTimeoutInMilliseconds* to 0. For example, you might not want retry when you're running the Redis server on the same machine as your application.
0 commit comments