Nginx 0.8.53/0.7.67 unable to return 304

Hi all,

need help with nginx configuration, I had configured a very simple
static file caching or direct from disk, but nginx did not return 304
when if-modified-since header is in the request.

if-modified-since exact;

    location / {

        root   /www;
        index  index.php index.html index.htm;
        expires 1d;

    }

thanks

rchen

Posted at Nginx Forum:

here is the request and response header

User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12)
Gecko/20101026 Firefox/3.6.12
Accept image/png,image/;q=0.8,/;q=0.5
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,
;q=0.7
Keep-Alive 115
Connection keep-alive
If-Modified-Since Fri, 10 Sep 2010 00:10:07 GMT
Cache-Control max-age=0

Server nginx
Date Tue, 09 Nov 2010 22:26:50 GMT
Content-Type image/gif
Content-Length 5541
Last-Modified Fri, 10 Sep 2010 00:10:07 GMT
Connection keep-alive
Expires Wed, 10 Nov 2010 22:26:50 GMT
Cache-Control max-age=86400
Accept-Ranges bytes

Posted at Nginx Forum:

Hi Maxim,

we have installed with default modules, and test with firefox 3.6.12 to
retrieve a gif file, not matter how we change the configuration, we
still get 200 in return.

Regards

Posted at Nginx Forum:

Hello!

On Tue, Nov 09, 2010 at 05:22:04PM -0500, rchen9012 wrote:

need help with nginx configuration, I had configured a very simple
static file caching or direct from disk, but nginx did not return 304
when if-modified-since header is in the request.

if-modified-since exact;

Just a side note: there is no such directive; there is
if_modified_since one.

    location / {

        root   /www;
        index  index.php index.html index.htm;
        expires 1d;

    }

The basic question is: how did you test?

Hint: never trust browsers and various “http headers” plugins, in
many cache-related cases they show incorrect info. Looking what
happens on the wire (tcpdump, wireshark) or at least intercepting
traffic with debugging proxy (fiddler) is recommended.

Maxim D.

On Wed, Nov 10, 2010 at 09:40:11AM -0500, rchen9012 wrote:

Hi Maxim,

we have installed with default modules, and test with firefox 3.6.12 to
retrieve a gif file, not matter how we change the configuration, we
still get 200 in return.

Could you create debug log of the request ?
http://nginx.org/en/docs/debugging_log.html


Igor S.
http://sysoev.ru/en/