Welcome! Log In Create A New Profile

Advanced

Re: memcached HTTP 304 patch

All files from this thread

File Name File Size   Posted by Date  
ngx_memcached.tar.bz2 895 bytes open | download Vicente Aguilar 11/16/2009 Read message
Vicente Aguilar
November 17, 2009 01:36AM
Hi

>> - 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!!
>
> Isn't it better to tell ngx_memcached to set the flags field and avoid
> patching the memcached server?

But nginx isn't the one setting the values on memcached, that's the app running on tomcat. Anyway I guess we could take a look at the flags on the first access to a key and if the field is uninitialized (0) set it to the current timestamp. But that wouldn't be the real modification time of that page, but that of the second access to it (fist time memcached misses and nginx passes control to tomcat who sets the value, second time the page is served from memcached). Wouldn't really make a difference, I guess. It would work. Anyway I don't like nginx setting it, nginx is the one serving it, not producing it.

Another less intrusive option is not modifying memcached and having the developers set the timestamp on the flags everytime they store something on memcached (or patch the library they use to access it). Quite easy to do, we could just overload the method they use to store stuff on memcached and set the timestamp there. But right now I wanted something automatic, something I could test without changing our app's code.

Regards

--
Vicente Aguilar <bisente@bisente.com> | http://www.bisente.com
Subject Author Posted

memcached HTTP 304 patch Attachments

Vicente Aguilar November 16, 2009 02:58PM

Re: memcached HTTP 304 patch

agentzh November 16, 2009 10:44PM

Re: memcached HTTP 304 patch

Vicente Aguilar November 17, 2009 01:36AM

Re: memcached HTTP 304 patch

agentzh November 17, 2009 02:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready