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

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

1 Answer 1

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
1  
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

 
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.