November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
You could add it to the controller you use the attribute on.
I would use the settings from Episerver though, for the values:
HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.Add(Settings.Instance.HttpCacheExpiration));
HttpContext.Current.Response.Cache.SetMaxAge(Settings.Instance.HttpCacheExpiration);
HttpContext.Current.Response.Cache.SetCacheability(Settings.Instance.HttpCacheability);
HttpContext.Current.Response.Cache.SetValidUntilExpires(true);
Hi thanks for this. I notice that max-age is 0 in the browsers headers.
Are these settings taken from the web.config file? If yes, I do not see anything in the web.config file called HttpCacheExpiration ?
Or is max-age=0 correct ??
The settings are taken from the applicationsettings in the Episerver node in the web.config. There you should set the httpCacheExpiration value
Thanks so much. I have added httpCacheExpiration="3600" to the web.config.
Interestingly when I check the headers in the browser I get max-age=31536000 which is 1 year if I am not mistaken. Is my value for httpCacheExpiration being misread, or is it supposed to be in ticks or something like that ?
Hi there,
Trying to set up outputcache but failing so far.
I have ensured that I have the following in my web.config:
And:
Next, I added [ContentOutputCache] to my StartPageController.cs like so:
But it does not appear to be working. I have ensured that I am not logged in during testing. But when looking at the headers in the browser I see under cache-control: private.
In the article it mentions:
The next part of the process is to enable the response headers on your page. If you don't do this you will see a no-cache set in your HTML requests response header. To do this is pretty simple. At some point on a page load you need to add the following code:
But I am unsure where to place this bit, and how to call it.