memcached

Saving variables on server in php

hi, Is there a way, in php, to save a variable on server so it stay there for all of the requests (not session, need to be saved for all users ever)? i'm new in php, in asp.net is use the 'application' context. thanks. ...

Homemade tiny memcache

I'm moving a Google App Engine web application outside "the cloud" to a standard web framework (webpy) and I would like to know how to implement a memcache feature available on Gae. In my app I just use this cache to store a bunch of data retrieved from a remote api every X hours; in other words I don't stress this cache too much. I'v...

What is a good function to map an id to memcache in a pool of servers?

Something like: host = getHost(id) >>> 172.16.25.52 Ideally, the algorithm should minimize the number of cache misses when the pool of servers is expanded / contracted. Are there any known algorithms out there that do this? Or libraries, potentially (I'm using Python). Thank you. ...

Django-nonrel Memcache on Google App Engine

I'm a designer still trying to code up my first app in Google App Engine as an experiment. I have got to the point where I want to set up memcache to cache my entire site following the instructions at: http://docs.djangoproject.com/en/dev/topics/cache/#memcached I am clear that I need to add in my settings.py the following: CACHE_BAC...

Working around memcached's lack of wildcard expiration in Rails fragment caching

I'm working on adding fragment caching to a Rails 3 site that has both logged in and anonymous users, and need to control when parts of the page expire based on when content displayed throughout the site is updated. Midway into this, I discovered that memcached doesn't support regexps for expire_fragment, so now I'm looking for ways arou...

memcaching php resouce objects

Say I have this code in PHP : $query = mysql_query("SELECT ..."); the statement returns a resource object. Normally it would get passed to mysql_fetch_array() or one of the mysql_fetch_* functions to populate the data set. I'm wondering if the resouce object - the $query variable in this case can be cached in memcache and then a wh...

Using multiple memcache servers in a pool

I'm going through the documentation and I'm a little confused as to how memcache does internal load-balancing if multiple servers are specified. For example: import memcache mc.set_servers(['127.0.0.1:11211','127.0.0.1:11212',]) mc.set("some_key", "Some value") print mc.get("some_key") Will the setting and retrieval of key "some_key"...

What's the best way to handle memcache servers that fail?

If the server doesn't respond during a set or get operation, will memcache remove the server from the pool automatically? ...

C# architecture advice: method to cache data in a structure?

Hi, I'd like to ask your expert advice on a workable architecture in C#. I have a C# service which responds to a request from a local user on the LAN, fetches packets of data from the internet, and crunches that data to produce arrays of data in a structure. Each data request takes about 2 seconds, and returns 4000 bytes. There could b...

Setting OPT_SERVER_FAILURE_LIMIT on PHP Memcached library

I wanted to know how OPT_SERVER_FAILURE_LIMIT constant (which I think is equivalent of MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT on libmemcached) works, so created a small code snippet like this: #!/path/to/php533/bin/php <?php function debugging_set($memcached, $key, $value) { $code = '$memcached->set($key, $value)'; var_dump(eval('r...

Getting latest memcached gem to build on Snow Leopard

I've tried everything I can find on every website out there, and I can not get this to build. $ ruby --version ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] Full error: http://gist.github.com/651945 Entire build: http://gist.github.com/651952 ...

Memcached installed but class not found

If I run phpinfo() it tells me that memcached is installed. memcached memcached support enabled Version 1.0.2 libmemcached version 0.44 Session support yes igbinary support no I installed it with sudo pecl install memcached But when I try to instantiate the memcached class it is not found: $mc = new Memcached(); ...

When linking to page with hash in url it flashes the top before jumping to id in IE

We are trying to link to a page and in that link we supply the has to point to an elements id on another page for it to jump immediately down to that element. We know that when checking this functionality on other sites most of the time you don't see the flash of top of the page before the page jumps, we don't know why this might be happ...

PHP Can't find save handler memcache

I'm busting my brains over this issue (it should be straightforward), but can't seem to find a solution so hopefully one of you can help me. I'm trying to store sessions using php's memcache extension. I'm running MAMP and have installed the extension correctly (I think...it shows up when I do phpinfo), am running the daemon and can c...

How to store complex data struts in Memcache

I have a data struts like this: category: subcategory: color:red name:pen Is there any better method to store if i want to load such data in memcache? or Is there any other better memory database? Thanks! ...