# How to update/store entries into memcache from C++ FastCGI process?

**URL:** <https://www.ruby-forum.com/t/how-to-update-store-entries-into-memcache-from-c-fastcgi-process/190196>\
**Category:** NGINX\
**Created:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/how-to-update-store-entries-into-memcache-from-c-fastcgi-process/190196 "2010-06-17T16:22:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drvirens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@drvirens](https://www.ruby-forum.com/u/drvirens)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/how-to-update-store-entries-into-memcache-from-c-fastcgi-process/190196/1 "2010-06-17T16:22:17Z")

</div>

Hello,

This is my first post here, so first and foremost, I would like to say I  
have fallen in love with nginx. 🙂 This is the most beautiful server I  
had ever seen before. Thank you so much for providing such a wonderful C  
server. 🙂 I totally love it. 🙂

Despite searching the internet (mainly github/stackoverflow/google ) for  
it, I did not find any clue(s) as to how will I store the contents in  
the memcache.

What I wanted to try out is something below:  
At the start the FastCGI process (written using FastCGI++ using C++  
course), I want to populate the memcache [either  
NginxHttpMemcachedModule or NginxHttpMemcModule] with, say, 1000  
thumbnails.

Please, can anyone here just point to me how can I do that? I know it  
must be really easy but I have spent quite a lot of time trying to do  
this.

PS: I did find example/article regarding this on Internet but that code  
is in PHP.

Link:

> **[speeding up your nginx server with memcached](http://lserinol.blogspot.com/2009/03/speeding-up-your-nginx-server-with.html)**
>
> Nginx is a high performance web and proxy (web and mail proxy) server. Generally, nginx is used as a front-end proxy server to Apache web...

I am mainly looking for equivalents of following two PHP calls in C/C++  
on that link (please search on that page) :

1. memcache\_connect
2. memcache\_add

Thank you very much in advance and please pardon if this sounds like a  
basic question.

Kind regards,  
~Viren

Posted at Nginx Forum:

> **[How to update/store entries into memcache from C++ FastCGI process?](https://forum.nginx.org/read.php?2,99228,99228#msg-99228)**
>
> Hello, This is my first post here, so first and foremost, I would like to say I have fallen in love with nginx. :-) This is the most beautiful server I had ever seen before. Thank you so much for providing such a wonderful C server. :-) I totally...

---

<div class="post-metadata">

**Author:** ![drvirens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@drvirens](https://www.ruby-forum.com/u/drvirens)\
**Post date:** [June 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/how-to-update-store-entries-into-memcache-from-c-fastcgi-process/190196/2 "2010-06-17T16:26:22Z")

</div>

Hi,

On Thu, Jun 17, 2010 at 12:32:02AM -0400, drvirens wrote:

> 

…

> I am mainly looking for equivalents of following two PHP calls in C/C++  
> on that link (please search on that page) :
> 
> 1. memcache\_connect
> 2. memcache\_add

libmemcache is a high-performance C interface for databases/memcached.  
memcached is a distributed memory object caching system, generic in  
nature, but intended for use in speeding up dynamic web applications  
by alleviating database load.

> **[Index of /~seanc/libmemcache/](https://people.freebsd.org/~seanc/libmemcache/)**

–  
Sergey A. Osokin,  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![drvirens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@drvirens](https://www.ruby-forum.com/u/drvirens)\
**Post date:** [June 17, 2010, 9:34pm UTC](https://www.ruby-forum.com/t/how-to-update-store-entries-into-memcache-from-c-fastcgi-process/190196/3 "2010-06-17T21:34:05Z")

</div>

Thank you Sergey for your reply. Also, thanks for the link for the  
libmemcache.

But I wanted to know how can I access the NginxHttpMemcachedModule or  
NginxHttpMemcModule cache (to add entries into it) from a fastCGI  
process? Or, are you trying to indicate that both of the above modules  
use libmemcache ? I am kind of confused here. ☹ Apologies for my  
extremely poor knowledge in this area!!

Posted at Nginx Forum:

> **[Re: How to update/store entries into memcache from C++ FastCGI process?](https://forum.nginx.org/read.php?2,99228,99589#msg-99589)**
>
> Hello, This is my first post here, so first and foremost, I would like to say I have fallen in love with nginx. :-) This is the most beautiful server I had ever seen before. Thank you so much for providing such a wonderful C server. :-) I totally...
