There are two call methods when setting the response cache header:
- Response. headers. Add (string key, string value)
- Response. cache. setmaxage (datetime)
InProgramIt is strange to encounter two problems in the application.
- My response. addheader ("last-modified", gtmttimestring) and then set response. cache. setmaxage (New timespan (7, 0, 0, 0 ))
The result does not have the first header in the output, and then response. cache. setlastmodified (lastmodified) is enough.
Guess: the output header cannot be used in two ways.
- Because the project requires that cache-control be set to public, I first response. cache. setcacheability (httpcacheability. Public), and then encountered a strange problem.
Because my program is a handler processing program, the sent ashx request will not be updated, and the same content will be returned each time. The content will be updated when the image is refreshed, And I will understand the original httpcacheability. public has been started.
Therefore, the results returned after the first time are all server-side caches.