It turns out that my settings are as follows:
Then, in the network request results, it was found that Cache-Control:private was still this value, and it did not work.
SetLastModified method: Used to set the Last-Modified HTTP header of the page. The Last-Modified HTTP header indicates when the page was last modified, and the cache will rely on it for timing. This method will fail if the cache limit hierarchy is violated. The argument of this method is an instance of the DataTime class.
SetSlidingExpiration method: This method sets cache expiration from absolute to tunable time. Its parameter is a boolean value. When the parameter is true, the Cache-Control HTTP header is updated with each response. This expiration mode is the same as the IIS configuration option that adds the expiration header to all output sets relative to the current time. When the parameter is False, the setting is retained, and any attempt to enable adjustable expiration will statically fail. This method does not map directly to HTTP headers. It is a subsequent module or secondary request to set the origin server caching policy.
SetOmitVaryStar method: A method added ASP.NET 2.0. Used to specify whether the response should include the vary:* header when differentiating by parameter. The method parameter is a boolean value, true to instruct HttpCachePolicy not to use a * value for its VaryByHeaders property; Otherwise it is false.
SetCacheability method: Used to set the Cache-Control HTTP header of the page. This header is used to control how documents are cached on the network. There are two overloading methods in this method, the difference is the parameters. One parameter for an overload method is the HttpCacheability enum values, including NoCache, Private, Public, Server, ServerAndNoCache, and ServerAndPrivate (see MSDN for definitions of these enum values). The other method has two parameters, one is the HttpCacheability enumeration value and the other is a string that represents the cache control extension added to the header. It is important to note that field extensions are only valid when used with Private or NoCache directives. If you combine incompatible instructions and extensions, this method will throw an invalid parameter exception.
Original link: http://www.cnblogs.com/haiyabtx/archive/2012/11/18/2776462.html
Solution:
Finally attached my filter:
|