NginxHttpMemcModule vie NginxHttpMemcachedModule

Danny Trinh dtrinh at
Tue Dec 29 19:36:07 MSK 2009

And that is the problem. We have many modules doing similar jobs, and
none of them is easy for users to get them work. I'm an admin, I can
feel how much frustrated it is. I think what the users want is the
module has easy way to setup and/or the clear sample/instruction that
they can go through. I'm not a developer, but I can help to test thing

Danny Trinh
Linux Admin

-----Original Message-----
From: Piotr Sikora [mailto:piotr.sikora at] 
Sent: Monday, December 28, 2009 11:01 PM
To: nginx at
Subject: Re: NginxHttpMemcModule vie NginxHttpMemcachedModule

> BTW, none of them can be serve as a transparent content cache out of
> the box. I can think of a ngx_cache module just like Apache2's
> mod_cache (with various storage backends like mod_disk_cache,
> mod_mem_cache, and mod_libmemcached_cache in that context). Is anyone
> already working on that?

I've got mixed feelings about this.

Regarding memcached / other storage backends:
I would love to see memcached module which would be able to act as a 
transparent cache for proxy/fastcgi/slowfs and save content to memcached

cluster(!), but the way I see it, it cannot be easily implemented as a 
module. In my opinion change of storage backends should be as
transparent as 
possible, which means that this should be implemented as modification of

existing {proxy,fastcgi,slowfs}_cache_path or addition of similar 
{proxy,fastcgi,slowfs}_memcached_path and nothing more (from
point of view).

This should be fairly easy to implement as a patch. Calling
function instead of ngx_ext_rename_file() in
should do the trick for writing and calling memcached_get function
of ngx_http_file_cache_read() in ngx_http_file_cache_open() should do
trick for reading ;)

(Yes, I already did the hard part :P)

Implementing this as a module probably wouldn't be as easy and as clean 

But does anyone actually need such feature?

Regarding ngx_cache module:
I believe it is NOT needed. It would be a lot(!) of code replicated from

nginx base, which would be a nightmare to maintain and keep compatible
all existing nginx versions. Also, it wouldn't add any real benefits
existing {proxy,fastcgi,slowfs}_caches and memcached storage backend 
described above.

But this is just my opinion ;)

Best regards,
Piotr Sikora < piotr.sikora at >

nginx mailing list
nginx at

More information about the nginx mailing list