HTTP Headers

Discussion in 'HTML / PHP / JavaScript / CSS' started by Me, Feb 26, 2004.

  1. Me

    Me

    I am having a problem using document.lastModified in a client script. From what I can tell, the Last-Modified: HTTP Header is not being sent for all of my pages. It works with my main page (index.aspx), but doesn?t work with any of my other pages.

    You can check the headers with this url: http://www.delorie.com/web/headers.html

    When I type in http://www.alleshouse.net/index.aspx. I get this:
    TTP/1.1 200 OK
    Cache-Control: public
    Content-Length: 4713
    Content-Type: text/html; charset=utf-8
    Expires: Fri, 27 Feb 2004 04:37:56 GMT
    Last-Modified: Fri, 27 Feb 2004 03:37:56 GMT
    Server: Microsoft-IIS/6.0
    X-AspNet-Version: 1.1.4322
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    Date: Fri, 27 Feb 2004 03:47:27 GMT
    Connection: close

    However, when I type in any other page, (for instance, http://www.alleshouse.net/contact_information.aspx) I get this:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 27 Feb 2004 03:50:47 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=dbdhhwqpxfzunt3ofdpxqinb; path=/
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 3693

    Any help would be appreciated.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    I got totally different result when i tried it

    Try use the temporary URL to test to be completely sure.



    quote:Originally posted by Me

    I am having a problem using document.lastModified in a client script. From what I can tell, the Last-Modified: HTTP Header is not being sent for all of my pages. It works with my main page (index.aspx), but doesn?t work with any of my other pages.

    You can check the headers with this url: http://www.delorie.com/web/headers.html

    When I type in http://www.alleshouse.net/index.aspx. I get this:
    TTP/1.1 200 OK
    Cache-Control: public
    Content-Length: 4713
    Content-Type: text/html; charset=utf-8
    Expires: Fri, 27 Feb 2004 04:37:56 GMT
    Last-Modified: Fri, 27 Feb 2004 03:37:56 GMT
    Server: Microsoft-IIS/6.0
    X-AspNet-Version: 1.1.4322
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    Date: Fri, 27 Feb 2004 03:47:27 GMT
    Connection: close

    However, when I type in any other page, (for instance, http://www.alleshouse.net/contact_information.aspx) I get this:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 27 Feb 2004 03:50:47 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=dbdhhwqpxfzunt3ofdpxqinb; path=/
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 3693

    Any help would be appreciated.

    </blockquote id="quote"></font id="quote">
     
  3. Me

    Me

    That?s really strange! I did as you suggested and tried the temporary url and came up with identical results. I?m not sure how you got different results.

    Just out of curiosity, what determines the HTTP headers that are sent to the client? If I?m not mistaken, this is all done on the server. I don?t think there is anything I could add in my code to force the headers to be sent. Is this correct?


    quote:Originally posted by bruce

    I got totally different result when i tried it

    Try use the temporary URL to test to be completely sure.



    quote:Originally posted by Me

    I am having a problem using document.lastModified in a client script. From what I can tell, the Last-Modified: HTTP Header is not being sent for all of my pages. It works with my main page (index.aspx), but doesn?t work with any of my other pages.

    You can check the headers with this url: http://www.delorie.com/web/headers.html

    When I type in http://www.alleshouse.net/index.aspx. I get this:
    TTP/1.1 200 OK
    Cache-Control: public
    Content-Length: 4713
    Content-Type: text/html; charset=utf-8
    Expires: Fri, 27 Feb 2004 04:37:56 GMT
    Last-Modified: Fri, 27 Feb 2004 03:37:56 GMT
    Server: Microsoft-IIS/6.0
    X-AspNet-Version: 1.1.4322
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    Date: Fri, 27 Feb 2004 03:47:27 GMT
    Connection: close

    However, when I type in any other page, (for instance, http://www.alleshouse.net/contact_information.aspx) I get this:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 27 Feb 2004 03:50:47 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=dbdhhwqpxfzunt3ofdpxqinb; path=/
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 3693

    Any help would be appreciated.

    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     
  4. Me

    Me

    OK, I figured out a few things. ASP.NET pages do not send the ?Last-Modified? header. This is kind of strange, but there are a few ways around it.

    One thing you can do is simply set the header within your code.

    ie (C#):
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    To my knowledge, http header is set by the server.

    I am not sure if you can manipulate it through code. I would try search in google.


    quote:Originally posted by Me

    That?s really strange! I did as you suggested and tried the temporary url and came up with identical results. I?m not sure how you got different results.

    Just out of curiosity, what determines the HTTP headers that are sent to the client? If I?m not mistaken, this is all done on the server. I don?t think there is anything I could add in my code to force the headers to be sent. Is this correct?


    quote:Originally posted by bruce

    I got totally different result when i tried it

    Try use the temporary URL to test to be completely sure.



    quote:Originally posted by Me

    I am having a problem using document.lastModified in a client script. From what I can tell, the Last-Modified: HTTP Header is not being sent for all of my pages. It works with my main page (index.aspx), but doesn?t work with any of my other pages.

    You can check the headers with this url: http://www.delorie.com/web/headers.html

    When I type in http://www.alleshouse.net/index.aspx. I get this:
    TTP/1.1 200 OK
    Cache-Control: public
    Content-Length: 4713
    Content-Type: text/html; charset=utf-8
    Expires: Fri, 27 Feb 2004 04:37:56 GMT
    Last-Modified: Fri, 27 Feb 2004 03:37:56 GMT
    Server: Microsoft-IIS/6.0
    X-AspNet-Version: 1.1.4322
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    Date: Fri, 27 Feb 2004 03:47:27 GMT
    Connection: close

    However, when I type in any other page, (for instance, http://www.alleshouse.net/contact_information.aspx) I get this:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 27 Feb 2004 03:50:47 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    MicrosoftOfficeWebServer: 5.0_Pub
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=dbdhhwqpxfzunt3ofdpxqinb; path=/
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 3693

    Any help would be appreciated.

    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     

Share This Page