views:

31

answers:

1

I need to set http header for disabling ie (7-8) caching (it disturbs my ajax functionallity). I've tried inserting this code to the head of my site.master with no result -

 <META HTTP-EQUIV="Pragma"
CONTENT="no-cache"> <META
 HTTP-EQUIV="Expires" CONTENT="-1">

How and where can I set the HTTP headers? or do you have a better solution for the ie caching issue.

regards.

A: 

Try:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]

This attribute, placed in controller class, disables caching. Since I don't need caching in my application, I placed it in my BaseController class:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public abstract class BaseController : Controller
{

Here is nice description about OutputCacheAttribute: Improving Performance with Output Caching

LukLed
thank you, worked perfectly
Gidon