When using nginx with memcached, all requests served off memcached have a 200 HTTP return code, as memcached doesn’t store the page timestamp (last-modified).
This patch has two parts:
- a memcached patch that stores the current epoch on the flags field when storing a new key-value pair. IMPORTANT: whatever flags the client tries to set get lost, as the server overwrites them with the current timestamp!
- a nginx patch to properly set the “last-modified” HTTP header according to the memcached-stored flags (timestamp), and return a 304 depending on the client’s “if-modified-since” header.
The patches have been tested with nginx 0.7.62 and memcached 1.2.2.
The latest release can be downloaded here: nginx-memcached-304-latest.tar.bz2