If you do not want the client to cache web pages on your server, you can control the following in ASP. NET:
Write in page_load:
Response. cache. setcacheability(Httpcacheability. nocache );
I found some interesting things during the test:
According to the HTTP 1.0 standard, you can directly use <meta http-equiv = "Pragma" content = "no-Cache"/>
According to the HTTP 1.1 Standard, you can use: <meta http-equiv = "cache-control" content = "no-Cache"/>
For the sake of insurance, both of them are used.
However, when I try to add these two meta tags to the ASPX page, the returned HTTP header shows cache-control: Private.
Moreover, ASP. NET cannot write the HTTP header Pragma to response through a program.
The final solution is to add <meta http-equiv = "Pragma" content = "no-Cache"/> to the ASPX page, and then writeResponse. cache. setcacheability(Httpcacheability. nocache );
In this way, the returned response contains the two headers that I expected:
Pragma: No-Cache
Cache-control: No-Cache
Strange. If anyone knows what I did wrong, please kindly advise.
========================================================== ========================
Here are some related articles:
How to: Set the cacheability of an ASP. NET page declaratively
How to: Set the cacheability of an ASP. NET page programmatically
There is also fiddler this tool is good, used to debug the use of HTTP protocol program is very good: http://www.fiddlertool.com/fiddler/
In addition: Recently, I have been familiar with HTTP protocols and various RFC types. I think it is really difficult to develop standards. It is very helpful. Finally, I have to be picked up. There is a saying in the IT industry: A third-stream enterprise is a product, a second-stream enterprise is a technology, and a first-class enterprise is a standard. It makes sense.
Are you interested in comparing rest and soap? We can exchange ideas.