The OutputCache filter is used as a cache to save users time and resources to access the application and improve the user experience, but I couldn't find any effect on it. Keep it as a note. The OutputCacheAttribute class has the following properties:
Attribute name | type | description | Duration | int | The cache time, measured in seconds, can theoretically be very long, but in practice, when system resources are tight, the cache space will still be reclaimed by the system. | VaryByParam | string | For example, when the "ID" field changes, the cache needs to be changed (the original cache can still be retained), then VaryByParam should be set to "ID". Here you can set the following values: * = Changes the cache when any parameter changes. none = does not change the cache. with a semicolon"; "List of field names for the interval = changes the cache if the fields in the list change. | locatio{filter}n | OutputCachelocatio{filter}n | Where to put cached data. The default is Any, and the other values are Client, Downstream, Server, None, and ServerAndClient | NoStore | bool | Secondary storage for deciding whether to block sensitive information. |
Let's focus on the VaryByParam property, which actually means that the url changes the cache according to the name of those parameters.
The default value of VaryByParam is *, which means that any parameter name can change the cache...
The above is the cache I set, only the URL connection parameter name is dir, sort, sort_model, the cache changes
For example, when the value value of the dir parameter changes, a cache will be regenerated, and the original cache will not be deleted!
|