1

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 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

is this will work with the page all for all the items related to my pages like images .
No this will only set the cache header for the HTML page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.