Using HTTP 304 code - TCP-IP

This is a discussion on Using HTTP 304 code - TCP-IP ; Hello I'm trying to make a web browser in vb6. I'm unable to hand to handle the 304 code (cache check). Can anyone tell me what request is sent by a browser to a webserver in order to check from ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Using HTTP 304 code

  1. Using HTTP 304 code

    Hello

    I'm trying to make a web browser in vb6. I'm unable to hand to handle
    the 304 code (cache check). Can anyone tell me what request is sent by
    a browser to a webserver in order to check from the webserver whether
    a file has been updated or not.

    Im trying to send this request:

    GET /test/index.asp HTTP/1.1
    Accept: */*
    Accept-Language: en-us
    Accept-Encoding: gzip, deflate
    If-Modified-Since: Mon, 28 Jul 2008 09:25:35 GMT
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    Q312461)
    Host: localhost
    Connection: Keep-Alive

    The 'if-modified-since' shows the date of the file on the server. As
    per my understanding, the server should return HTTP 304 code if the
    file is of the same date on the server. But instead its returning the
    complete file again. Therefore my cache system is not working
    properly.

    Any advises ?

  2. Re: Using HTTP 304 code

    On Jul 28, 4:47*am, Faraz Azhar wrote:

    > GET /test/index.asp HTTP/1.1


    > The 'if-modified-since' shows the date of the file on the server. As
    > per my understanding, the server should return HTTP 304 code if the
    > file is of the same date on the server. But instead its returning the
    > complete file again. Therefore my cache system is not working
    > properly.
    >
    > Any advises ?


    It may simply be that you are testing with an object that is not
    cacheable. Try testing with an image rather than the output of a
    script.

    If 'index.asp' is a script (which it sounds like), the *output* of the
    script can change even if the script hasn't change. In general,
    there's no way for the system to know whether you have cached the
    script's current output, so it will not honor If-Modified-Since
    requests.

    You are doing the right thing. You aren't supposed to cache this, and
    you aren't. Try with a static object, like an image.

    DS

  3. Re: Using HTTP 304 code

    On Jul 28, 4:59*pm, David Schwartz wrote:
    >
    > It may simply be that you are testing with an object that is not
    > cacheable. Try testing with an image rather than the output of a
    > script.
    >
    > If 'index.asp' is a script (which it sounds like), the *output* of the
    > script can change even if the script hasn't change. In general,
    > there's no way for the system to know whether you have cached the
    > script's current output, so it will not honor If-Modified-Since
    > requests.
    >
    > You are doing the right thing. You aren't supposed to cache this, and
    > you aren't. Try with a static object, like an image.
    >
    > DS



    OK.. I guess you're right.. Do you think I need to include If-None-
    Match thing ? (by the way I don't know how to use If-None-Match.. I
    think it uses some cache)

+ Reply to Thread