how to add an Expires or a Cache-Control Header programmatic in #asp.net?
开发者_运维百科i host my web site into a shared hosting and i need to set expiration header using iis but i didn't find my hosting allow this feature so , is there any way to set it into my web configuration or into my code ??
Google is your friend :)
MSDN Article: HttpResponse.AddHeader Method
You can also use HttpResponse.AppendHeader, which is semantically the same as HttpResponse.AddHeader.
Good Luck.
You can use this code in Page_Load
Response.Headers.Add("Expires", "ddd, dd m YYYY hh:mm:ss GMT");
You have to change the date for yours
精彩评论