I can't seem to find enough documentation. I have an app that generates some dynamic responses, but could still benefit from the Last-Modified
header -- so I send it.
However, turning on if_modified_since
(set to before
, per http://nginx.org/en/docs/http/ngx_http_core_module.html#if_modified_since) doesn't seem to have any effect on non-static resources. E.g., php, python apps.
Is this because Nginx isn't just looking at my response Last-Modified
header? Because I can see that they appear to be set correctly, as below:
> GET /3.0/view.json?id=2 HTTP/1.1
> Host: xxxxxxxxxxxxx
> Accept: */*
> If-Modified-Since: Sat, 02 May 2015 19:43:02 GMT
>
< HTTP/1.1 200 OK
* Server nginx/1.4.7 is not blacklisted
< Server: nginx/1.4.7
< Date: Fri, 01 May 2015 19:56:05 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Last-Modified: Fri, 01 May 2015 19:56:05 GMT
Or is there something larger that I'm overlooking? Just curious how
if_modified_since
is implemented, compared to where I'm setting my expectations. I assumed it would just look at the response headers, and over-ride the status as necessary. Am I wrong?