+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Sitefinity Set Response Headers

Sitefinity Set Response Headers

3 posts, 0 answered
  1. Shubhankar
    Shubhankar avatar
    3 posts
    Registered:
    19 Sep 2014
    11 Apr
    Link to this post

    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

  2. Shubhankar
    Shubhankar avatar
    3 posts
    Registered:
    19 Sep 2014
    11 Apr in reply to Shubhankar
    Link to this post
    I'm using  Sitefinity 7.2
  3. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    14 Apr
    Link to this post
    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>


    Regards,
    Stanislav Velikov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
3 posts, 0 answered