memcached

Memcache compression - good/bad?

I was curious... are there any pro/cons of using compression in memcache? ...

Change serialization functions in PHP for Memcached

By default Memcached module in PHP uses PHP's built in serialization functions. Because I'm accesing the same keys from other programming languages, I have found a serialization module that works in all languages. How do I use my serialization module instead of PHP's when storing/retrieving keys from Memcached? ...

Apache server cache images

Hi, On my Apache server I have a PHP service that gets requests and generates an image from them. What I want to do is to cache the generated image on my server (not client's browser) once it was generated, so if the image with specific parameters has been generated already and someone requests it my web server will return cached image ...

Is libevent required for building memcached for windows?

I accidentally deleted my previous post. Could I know exactly why I should compile libevent to be able to build memcached? Actually, I can already use memcached for windows without compiling libevent and I also installed memcached as a service. Nothing odd happens. ...

What does "Automatic cleaning is not available/necessary with this backend" mean? (for memcache )

I have installed the memcache in my php zend code. it seems no error. but there is a warning in the log saying Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend. what does it really mean? ...

Memcache Vs. Memcached

Someone can explain me the difference from Memcache and Memcached in PHP environment? What are the advantages of one over the other? Can you also suggest that the criteria used to choose between one or the other? ...

Patterns for dealing with memcache Caching in Django

I have a big Django project with several interrelated projects and a lot of caching in use. It currently has a file which stores cache helper functions. So for example, get_object_x(id) would check cache for this object and if it wasn't there, go to the DB and pull it from there and return it, caching it along the way. This same pattern ...

How do you use memcached with Prepared Statements?

Caching regular SQL queries is simple enough. public function query($sql) { if( $result = cache::get(sha1($sql)) ) { return $result; } $result = $this->connection->query($sql); cache::set(sha1($sql), $result); return $result; } But how do you cache queries with prepared statements since you don't know what t...

Physical/in-Memory database. (for logging purposes on my website)

We all know MYSQL. We all know memcached. I love memcached. You have a string key , and it returns a value. Dead simple. Is there a database for memory? For example, I am building a website that needs to keep track of LOGGING. Everything people do...I need to keep track of. But it would be slow to write to disk every time someone hi...

In memcached, you can put a List as a value. Can you put a list in beanstalkd?

Actually, I would like to use this for logging. I want to put a dictionary into beanstalkd. Everytime someone goes into my website, I want to put a dictionary into beanstalkd, and then every night, I want a script that will get all the jobs and stick them in the database. THis will make it fast and easy. ...

memcache "catastrophic event fd doesn't match conn fd"

I've got this error when a client tries to access memcache: "catastrophic event fd doesn't match conn fd" What went wrong? ...

MAMP: How to install Memcached?

Hi Guys, I have tried to install memcached in MAMP - Snow Leopard 10.6.2 using this tutorial: Setup a Memcached-Enabled MAMP Sandbox Environment I finished with no errors the first to the last step: Bonus Section: Start and Stop Memcache with MAMP After that I restarted my MAMP widget in the dashboard and checked by phpinfo but the m...

Whats the best way to manage keys (in memcache ) to prevent stale cached values?

Ive recently implemented memcache on my site which has been under heavy mysql load (mysql was as optimized as I could make it). It solved all my load issues, and site is running beautifully. The problem that Im facing now is stale cached values. I have 1hr auto expiration times on most pages, and Im also deleting the key when the value...

Python memchached client library with CAS support

I need to use gets and cas (check and set) commands of memcached from Python application. The only Python client library supporting them I found is Twisted. But Twisted requires quite different design of application, so it's not an option. Is there any other full-featured (not listed on official page) Python library for memcached? Pure P...

How does incr work with expiry times?

In memcached (appengine api implementation), how does expiration interact with incr()? There isn't a time argument for incr(), but what happens if I add the key with another call rather than using the initial_value param, like so: memcache.add('testcounter', 0, time=60*90) newcnt = memcache.incr('testcounter') will testcounter stil...

APC works sporadically. Any idea why?

Ive been using memcache before, decided to try out APC. Im having problems with it actually reading values, and respecting the expiry dates. I can set a 10 min expired date on a piece of data. Refresh the page, which will run a mysql query and cache the result into a key. On next load, it checks to see if the key is set, and if it is, it...

Drupal — Fatal error: Class 'Memcache' not found

Hello, I have installed drupal on my localhost. It worked well 2 months ago, but now something happened and I don't know why. I'll be very grateful if you can help me. Thanks in advance. The full error looks like this: Fatal error: Class 'Memcache' not found in /srv/www/htdocs/modules/memcache/dmemcache.inc on line 177 1) ph...

PHP extension that uses memcached

I am thinking of writing a PHP extension library that will use the memcached library. It is trivial to simply link my library to the memcache shlib. However, I am not sure what will happen if my (extension library) user already uses memcache on his/her website. My questions are: Is it possible to have (possibly different versions) of...

Memcache to deal with high latency web services APIs - good idea?

I have a PHP application that calls web services APIs to get some objects before rendering a web page that incorporates those objects. In some cases these APIs are really slow (seconds) and that is not acceptable from a user experience point of view. Two things I know I can do... Use ajax and make these calls in the background Time out...

Best practices on cache implementation

I would need to implement cache, which would need to perform SQL queries and cache results. So, I would love to read something about best practices of doing that; how do properly, staling cache results, checking, etc. Particularly, I would probably benefit from learning how Hibernate is doing that? Or some other good players :-) ...