Net 4 and C #.
I need to configure sending in the Cache-Control Browser ( Cache-Control: no-cache ) in the HTTP Response header for the web form page.
Cache-Control: no-cache
Any idea how to do this?
Thank you for your time.
Try the following:
Response.AppendHeader("Cache-Control", "no-cache");
However, you should be aware that only this header will not give you a reliable cross-browser way to prevent caching. See this answer for a more accurate solution: Make sure the webpage is not cached in all browsers
In MVC, you can set it in the Controller class, so View does not use the cache;
public ActionResult User() { Response.CacheControl = "no-cache"; return View(); }
For the Dotnet kernel:
Response.Headers.Append("Cache-Control", "no-cache, no-store, must-revalidate");
Source: https://habr.com/ru/post/1369643/More articles:Why is OpenGL fog just not showing up? - c ++How to check child objects by implementing IDataErrorInfo in parent class - c #Python decoding works for me, but not for others - pythonProblems with ORMLite and lazy collections - androidDetermine the owner of the internal memory used by a C # application - c #Do I include my unit tests in my Ad Hoc archive? - iphoneHow to wait time out without killing a child? - perlElement "UpdatePanel" is not a known element - asp.netShow transparent activity in Android? - androidHow can I manipulate file names using bash and sed? - bashAll Articles