views:

68

answers:

1

Hi,

Is it possible to declaratively set clientCaching for an Action using the web.config in IIS7.
We need to set an expiry value of 1 day for our Home/Index Action. As of now we are doing this using a filter attribute. Is it possible to accomplish the same declaratively?
We are able to do it for static content, but not for Action Methods through the Location and system.webServersections in the web.config.

[location path="Content"]
[system.web]
[authorization]
[allow users="*"/]
[/authorization]
[/system.web]
[system.webServer]
[staticContent]
[clientCache httpExpires="Sat, 28 Nov 2009 09:00:00 GMT" cacheControlMode="UseExpires" /]
[/staticContent]
[/system.webServer]
[/location]

A: 

I don't think it would be possible to do so in web.config - we create a base controller and put it in there. That way we don't have to decorate all of our actions with attributes.

Jess