Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i try to control my iis6 caching i was able to set

Cache-Control   public, max-age=1000000

but i can't set the

Expires 

any help?

share|improve this question
add comment

1 Answer

Are you trying to set this server side or in code?

In IIS6 you can set this up by:

  1. Right-click on your site and get Properties
  2. Click the HTTP Headers tab
  3. Check the Enable Content Expiration box and set the time you want things to expire

OR

  1. Right-click on your site and get Properties
  2. Click the HTTP Headers tab
  3. Click the Add... button under Custom HTTP Headers. Enter Expires in the Header Name box and a valid HTTP Date in the Header Value field (something like 30 Oct 2015 14:19:41 GMT)

In Code you do this by adding a <META> tag to the HTML.

<META HTTP-EQUIV="Expires" CONTENT="30 Oct 2015 14:19:41 GMT">

Note, there are many other factors involved with caching web content other than just the Expires header. Have a read through this caching article.

share|improve this answer
    
can i set the expires date automatic? (so it always be one year?) –  user48228 Aug 25 '10 at 14:03
    
@user48228 Sorry, some of my post got cut out. See my edit. Use the first option and set the expiration time to 365 days. –  squillman Aug 25 '10 at 14:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.