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 ??
2 Answers
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.
Comments
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
2 Comments
Carlos Muñoz
No this will only set the cache header for the HTML page.