I have set up for NginxHttpMemcachedModule and it works great reading
output that I have set to Memcached server through my OWN PHP code. But
that means I have to modify my PHP code to make it happens and sometimes
it is not easy if the code is third party. I really think it would be
more beneficial if the NginxHttpMemcachedModule could set the generated
PHP output into Memcached server. By doing so, I don’t have to modify
PHP code to make it happen and it offers much better maintenance, using
Nginx server as the Memcache (cluster) Proxy.
Basically I need to be able to read PHP output from Memcached server:
If there is PHP output in the Memcached server given $uri, use it
If not, use fallback to the fastcgi or PHP-FPM
The generated PHP output of step 2 is set to the Memcached server BY
NGINX TRANSPARENTLY (no PHP code change but just Nginx configuration) to
the Memcached server so it can be read next time on step 1.
I notice that there is another module call NginxHttpMemcModule. It seems
that it could do the trick but I am not sure by looking at the
configuration example in the wiki.
However, the answer I got was on the cryptic side with the only thing I
could make out being it is not a good idea with proxy which I use as at
yet so I gave up.
However, the answer I got was on the cryptic side with the only thing I
could make out being it is not a good idea with proxy which I use as at
yet so I gave up.
Dayo, thank you for the response. It seem that is what I am looking
for. I am going to try it out and see if it works.
Given the fact that this is still on the “bleeding edge” side of Nginx
usage, I am thinking it might be better off if I will just use a
“middleware” PHP to handle the update to the memcached server.
If there is PHP output in the Memcached server cluster given $uri,
use it (with header stuff set)
This memcached_update.php will open up a output buffer, perform a url
get for the content of the original url, store the buffered content in
memcached server (unfortunately that means this PHP will need to perform
memcached server look up and cluster management in a clustered memcached
environment) and return the content
Next time the same location is requested, we should have the content
available in the memcached server cluster.
This should not have impact on the original application as the
“middleware” PHP is generic. But still it is a messy hack. It is not
“pretty”
I really hope NginxHttpMemcachedModule or NginxHttpMemcModule should
bundle this critical capability in the modules directly. It seems so
obviouos this job belongs to these two modules.
Thanks
– Jin Kuang
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.