Re: Pages are not served correctly (http return code 304)

Discussion in 'ASP .Net' started by Craig Deelsnyder, Jul 13, 2004.

  1. Avijit wrote:
    > Hi:
    >
    > I have written a small ASP.NET app to display various graphs and data using C# codebehind classes etc. and works for the most part fine on a local machine (i.e., browser on the same XP Pro box where IIS is running).
    >
    > The problem is I am getting response code 304 randomly for some of the pages (one of them just displays a few images) and when I access this application from another computer most of the page requests are getting 304 and as a result it's not working properly.
    >
    > Here is part of the server log:
    >
    > --------------------------------
    > 20:45:55 127.0.0.1 GET /about.aspx 200
    > 20:45:55 127.0.0.1 GET /doc-styles.css 200
    > 20:45:55 127.0.0.1 GET /images/banner_image_omni3.jpg 304 <===========
    > 20:45:55 127.0.0.1 GET /images/watermark.png 304 <===========
    > 20:45:55 127.0.0.1 GET /images/top-menu-bg.png 200
    > --------------------------------
    >
    > I am not sure what's wrong.
    >
    > Here is the configuration for my system:
    >
    > 1. OS Win XP Pro SP 1
    > 2. IIS 5.1
    > 3. ASP.NET 1.1.4322.573


    doesn't 304 mean 'not modified'? i think that's valid, as the browser
    asks with an 'if-modified-since', but the server says no need to resend,
    it's still 'current content'....sounds more like a browser problem,
    asking for that check, but not utilizing it correctly...have you tried
    other browsers?

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
     
    Craig Deelsnyder, Jul 13, 2004
    #1
    1. Advertising

  2. I have tried IE 6.0, Opera 7.5 and Firefox 0.9.2.
    Should I be setting something in the response header (saying that content expired?)

    Thanks,

    Avijit


    "Craig Deelsnyder" wrote:

    > Avijit wrote:
    > > Hi:
    > >
    > > I have written a small ASP.NET app to display various graphs and data using C# codebehind classes etc. and works for the most part fine on a local machine (i.e., browser on the same XP Pro box where IIS is running).
    > >
    > > The problem is I am getting response code 304 randomly for some of the pages (one of them just displays a few images) and when I access this application from another computer most of the page requests are getting 304 and as a result it's not working properly.
    > >
    > > Here is part of the server log:
    > >
    > > --------------------------------
    > > 20:45:55 127.0.0.1 GET /about.aspx 200
    > > 20:45:55 127.0.0.1 GET /doc-styles.css 200
    > > 20:45:55 127.0.0.1 GET /images/banner_image_omni3.jpg 304 <===========
    > > 20:45:55 127.0.0.1 GET /images/watermark.png 304 <===========
    > > 20:45:55 127.0.0.1 GET /images/top-menu-bg.png 200
    > > --------------------------------
    > >
    > > I am not sure what's wrong.
    > >
    > > Here is the configuration for my system:
    > >
    > > 1. OS Win XP Pro SP 1
    > > 2. IIS 5.1
    > > 3. ASP.NET 1.1.4322.573

    >
    > doesn't 304 mean 'not modified'? i think that's valid, as the browser
    > asks with an 'if-modified-since', but the server says no need to resend,
    > it's still 'current content'....sounds more like a browser problem,
    > asking for that check, but not utilizing it correctly...have you tried
    > other browsers?
    >
    > --
    > Craig Deelsnyder
    > Microsoft MVP - ASP/ASP.NET
    >
     
    =?Utf-8?B?QXZpaml0?=, Jul 14, 2004
    #2
    1. Advertising

  3. Hi Avijit,

    As for the 304 code, its the normal response from the webserver when the
    client browser request some certain static resources such as images. The
    client browser will send with a date of the client cache and the webserver
    return the status code indicate whether the requested resouce has been
    modified or not. 304 means hasn't been modified:
    #http status code
    http://msdn.microsoft.com/library/en-us/winhttp/http/http_status_codes.asp?f
    rame=true

    And I think you can first try clearing the client browser's cache files and
    retest again to see whether this can solve the problem.
    In addition, as for the set the content expired in WebServer, you can set
    it in IIS managed console, in the
    "HTTP Headers" panel of the Manage Console, then check the
    "Enable Content Expiration" option,
    after that, you'll see three option below it, choose
    "Expire Immediately" will make the response expire at once without client
    caching.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Jul 14, 2004
    #3
  4. I ran into a different problem and hoping that you will be able to send me some info. While trying to use your suggestion, I also installed an automatic update that fixes an IIS bug (KB811114).

    After this installation, I cannot open my project using visual studio - the "Connecting to the web server" dialog remains open forever. I am also unable to see the web pages .. browser (IE 6.0 ) hangs forever and the web log shows the following error:

    ----------------------
    07:56:29 127.0.0.1 GET /MyApp/get_aspx_ver.aspx 404
    07:56:29 10.5.1.78 OPTIONS / 200
    07:56:29 10.5.1.78 PROPFIND /WWWROOT$ 404
    07:57:17 127.0.0.1 GET /WebApplication1/WebForm1.aspx 500

    ----------------------

    Please note that I was also unable to create a new Web app using visual studio.

    How do I fix it?

    Thanks,

    Avijit


    "Steven Cheng[MSFT]" wrote:

    > Hi Avijit,
    >
    > As for the 304 code, its the normal response from the webserver when the
    > client browser request some certain static resources such as images. The
    > client browser will send with a date of the client cache and the webserver
    > return the status code indicate whether the requested resouce has been
    > modified or not. 304 means hasn't been modified:
    > #http status code
    > http://msdn.microsoft.com/library/en-us/winhttp/http/http_status_codes.asp?f
    > rame=true
    >
    > And I think you can first try clearing the client browser's cache files and
    > retest again to see whether this can solve the problem.
    > In addition, as for the set the content expired in WebServer, you can set
    > it in IIS managed console, in the
    > "HTTP Headers" panel of the Manage Console, then check the
    > "Enable Content Expiration" option,
    > after that, you'll see three option below it, choose
    > "Expire Immediately" will make the response expire at once without client
    > caching.
    >
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > Get Preview at ASP.NET whidbey
    > http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    >
    >
     
    =?Utf-8?B?QXZpaml0?=, Jul 14, 2004
    #4
  5. Hi Avijit,

    Thanks for your followup. From the further information you provided, the
    problem seems become more complex and seems that there're something wrong
    with the ASP.NET service on that machine. I think we could start from the
    following steps first:

    1. Since the log indicate that you can't visit the asp.net web pages, then
    what about view static Html pages in a virtual folder? If work then try
    view a asp page to see it works.

    2. If The #1 work, then try make a very simple aspx page(no code behind
    needed)
    and put into a certain virutal folder and see whether it can work. If this
    not work, I'm afraid the asp.net installed on the machine may be corrupted.

    Also, you can have the IIS restart first before performing the above tests.
    And if you have any other findings, please also feel free to post here.
    Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Jul 15, 2004
    #5
  6. Craig Deelsnyder

    Joe Fallon Guest

    IE 6 - is probably set like this:
    Tools
    Internet Options
    Settings
    Automatically

    Change Automatically to Every Visit To Page
    --
    Joe Fallon



    "Avijit" <> wrote in message
    news:...
    > I have tried IE 6.0, Opera 7.5 and Firefox 0.9.2.
    > Should I be setting something in the response header (saying that content

    expired?)
    >
    > Thanks,
    >
    > Avijit
    >
    >
    > "Craig Deelsnyder" wrote:
    >
    > > Avijit wrote:
    > > > Hi:
    > > >
    > > > I have written a small ASP.NET app to display various graphs and data

    using C# codebehind classes etc. and works for the most part fine on a local
    machine (i.e., browser on the same XP Pro box where IIS is running).
    > > >
    > > > The problem is I am getting response code 304 randomly for some of the

    pages (one of them just displays a few images) and when I access this
    application from another computer most of the page requests are getting 304
    and as a result it's not working properly.
    > > >
    > > > Here is part of the server log:
    > > >
    > > > --------------------------------
    > > > 20:45:55 127.0.0.1 GET /about.aspx 200
    > > > 20:45:55 127.0.0.1 GET /doc-styles.css 200
    > > > 20:45:55 127.0.0.1 GET /images/banner_image_omni3.jpg 304

    <===========
    > > > 20:45:55 127.0.0.1 GET /images/watermark.png 304

    <===========
    > > > 20:45:55 127.0.0.1 GET /images/top-menu-bg.png 200
    > > > --------------------------------
    > > >
    > > > I am not sure what's wrong.
    > > >
    > > > Here is the configuration for my system:
    > > >
    > > > 1. OS Win XP Pro SP 1
    > > > 2. IIS 5.1
    > > > 3. ASP.NET 1.1.4322.573

    > >
    > > doesn't 304 mean 'not modified'? i think that's valid, as the browser
    > > asks with an 'if-modified-since', but the server says no need to resend,
    > > it's still 'current content'....sounds more like a browser problem,
    > > asking for that check, but not utilizing it correctly...have you tried
    > > other browsers?
    > >
    > > --
    > > Craig Deelsnyder
    > > Microsoft MVP - ASP/ASP.NET
    > >
     
    Joe Fallon, Jul 15, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shahid Siddiqui
    Replies:
    2
    Views:
    338
    Cowboy \(Gregory A. Beamer\)
    Oct 15, 2003
  2. manofsteele

    ASP pages not being served correctly

    manofsteele, Oct 22, 2003, in forum: ASP General
    Replies:
    3
    Views:
    171
    Dave Anderson
    Oct 22, 2003
  3. Jeff
    Replies:
    2
    Views:
    204
  4. Martin Pirker

    overhead of WEBrick served http?

    Martin Pirker, Oct 11, 2004, in forum: Ruby
    Replies:
    3
    Views:
    130
    Martin Pirker
    Oct 12, 2004
  5. Replies:
    0
    Views:
    113
Loading...

Share This Page