Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've several areas on my web application where the user is allowed to download Microsoft Office documents. I need to apply the fix listed here

Web sites that want to allow this type of operation should remove the no-cache header or headers.

How to do this?

share|improve this question
up vote 2 down vote accepted

Setting the CacheControlMode parameter as described in IIS7 documentation should do what you want:

To set the expires response header to expire content periodically and to set the number of seconds, minutes, hours, or days at which to expire the content, use the following syntax:

appcmd set config /section:staticContent /clientCache.cacheControlMode:UseMaxAge /clientCache.cacheControlMaxAge: timeSpan 

The variable timeSpan is the time at which to expire the content. The format for timeSpan is d.hh:mm:ss, where d is the optional number of days, hh is the number of hours, mm is the number of minutes, and ss is the number of seconds at which to expire the content. For example, to set the cache to expire every two days, type the following and then press ENTER:

appcmd set config /section:staticContent /clientCache.cacheControlMode:UseMaxAge /clientCache.cacheControlMaxAge:2.00:00:00
share|improve this answer
Actually, the opposite of that. – TristanK Jan 11 '12 at 2:50
Oh, misread the question so I thought he wanted no-cache set. Thanks for noticing. – the-wabbit Jan 11 '12 at 8:09

Your Answer


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.