Sitefinity Set Response Headers
Hi,
On my web site I want to set expires response headers as 0. I tried the following code on a Page_Load of a dummy aspx page which I created in visual studio.
Response.AppendHeader("Expires", "0");
But, when I added the same code on Page_Load of the Master Page of the aspx page which I created in sitefinity it doesn't work. Same result on user control used on that page.
Please see the attached screenshots.
Can anyone help?
Thanks,
Shubhankar
I'm using Sitefinity 7.2
Hello Shubhankar,
The header "Expires" is only added to authenticated backend users in Sitefinity when the In-line editing functionality is enabled. This is not visible to visitors of the site.
To remove the Expires -1 header for authenticated Sitefinity users that currently are the ones that can ssee it. Disable inline editing functionality by going to Administration->Settings->Advanced->Pages and set the value of textbox Enable In-Line editing to False, then save changes.
Since there is no Expires header added by Sitefinity add one if needed, for example adding it in web.config.
<
system.webServer
>
<
httpProtocol
>
<
customHeaders
>
<
add
name
=
"Expires"
value
=
"1"
/>
</
customHeaders
>
</
httpProtocol
>