1

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?

O.O
  • 349
  • 1
  • 3
  • 10

1 Answers1

2

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
the-wabbit
  • 40,737
  • 13
  • 111
  • 174