memcached

Intercepting calls to methods in PHP

I have a class with static methods, and I would like to intercept method calls before the methods are called. So if I call $model = DataMapper::getById(12345); then I want some method in DataMapper to be called before this method is called, and then optionally this intercepting method can subsequently call self::getById(12345). Is t...

Any distributed cache systems that allows for tagging content?

I'd like to know if there is any distributed cache systems like memcached, velocity or sharedcache that allows me to tag content with more than just it's name, or that can relate items to eachother, so if i invalidate the cache for one item it also invalidates the related items too. eg. if i have two pages that reference the same data a...

Caching images in Memcached

The user profile images are stored in a separate fileserver, and I am thinking of caching them in memcached. The memcached server is local to the app, and each image is less than 1MB. But I saw over here that using memcached for images is a bad idea. Is it really? I am really not convinced. Any best practices and suggestions? I am usin...

How to implement memcached using a database ?

As far as I know, memcached runs in-memory and does not have a persistent backing-store. Currently my team is not ready yet to use memcached. So, I plan to write a simple database backed alternative. My question is pretty much in similar vein to this other question http://stackoverflow.com/questions/33619/concurrent-logins-in-a-web-f...

Caching of current user specific pages

We are using Smarty Templates on our LAMP site but my question would also apply to a site running Memcached (which we are planning to also bring online). Many of the pages of our user generated site have different views depending on who is looking at them. For instance, a list of comments where your own comments are highlighted. There...

Memcache maximum key expiration time

Hi, What's memcached's maximum key expiration time? If I don't provide an expiration time and the cache gets full, what happens? ...

Selectively caching models with cache_money

Instead of doing this in the cache_money.rb initializer class ActiveRecord::Base is_cached :repository => $cache end I want to be able to selectively cache only certain models (the reason being our User model breaks memcached because it's generally too large to be serialized properly). class User < AR::Base is_cached :repository ...

memcached or lucene.net with nhibernate

Hi, Does anyone have used memcached as a level2 cache or lucene.net for searching with nhibernate ? Can you please share your advances on nhibernate caching & indexing/searching. And, is memcached (with enyim cilent on the same machine by appserver) the fastest l2cache solution with nhibernate ? Best Regards sirmak ...

Using Memcache for storing connection objects

Is it advisable to store SQL Connection objects in memcache? ...

simpledb, sql azure, mysql + memcached

For a new scalable high traffic global ecommerce website (asp.net) project which technology fits best (max. scalability & performance, min. price & maintenance)? amazon simpledb, microsoft sql azure, mysql + memcached combo, or your solution... ...

Replacing an item in memcached without changing the expiration time

I have several items on memcached that should expire 24h after the creation time. I need to update those items, while keeping the expiration time unchanged. How can I do this? Apparently the replace function requires an expiration parameter. ...

How to synchronize access to ehcache, memcached & other key-value stores ?

From my understanding, each of these methods: get() and put() are atomic. But, when accessing caches like ehcache & memcached, in a CheckThenAct fashion, race conditions will arise. What should we synchronize on to ensure that if thread1 does a Get() and thread2 does a Get() followed by a Put(), that the first Get() will receive the ne...

memcacheD This is ok?

I'm new to memcached. Is this code vulnerable to the expired cache race condition? How would you improve it? $memcache = new Memcache; $memcache->connect('127.0.0.1'); $arts = ($memcache===FALSE) ? FALSE : $memcache->get($qparams); if($arts===FALSE) { $arts=fetchdb($q, $qparams); $memcache->add($qparams, $arts, MEMCACHE_COMPRESSED, 60...

Maximum size of object that can be saved in memcached with memcache.py

Hi, I need to return a rather big file (11MB) to the user. For certain reasons, I can't just provide a direct url to the file (http://www.sample.com/mybigfile.exe); instead it must be accessed through code. Instead of having to read it from disk over and over, I thought of saving it in memcached (if this is not a good idea, let me know...

scaling up using memcached to store gzipped file

I have a web service that serves a javascript source file to browsers. The javascript file is compiled by php in real time with some file includes. The resulting file changes only a few times a day. It is gzipped by apache before being served to browsers. I'd like to use memcached to serve it from memory to avoid disk and cpu loads of f...

Replace PHP Sessions

I have a social network type app I have been working on for at least 2 years now, I need it to scale well so I have put a lot of effort into perfecting the code of this app. I use sessions very often to cache database results for a user when a user logs into the site I cache there userID number, username, urer status/role, photo URL, on...

is it time to move from memcache to memcached

In 2009-07-07 was released the first stable of memcached, the php library based on libmemcached. Now you have two options (in php) memcache or memcached. memcache is the usual one, but memcached promise many improvements over the other one: one of my favorites are fact of use libketama for keys which allow sharing keys between language...

Using Memcache vs Memcached with PHP

It seems that PHP has two memcached libraries named memcache and memcached. What is the difference and how do you know which one to use? Is one outdated? It seems that memcached offers more methods so I would assume that means it has had the most development - but it also seems to require external C/C++ libraries so I'm not sure if I can...

Faulty to use memcache together with a php web-browser-game in this way?

Background We are currently working on a strategy web-browser game based on php, html and javascript. The plan is to have 10,000+ users playing within the same world. Currently we are using memcached to: store json static data, language files store changeable serialized php class objects (such as armies, inventorys, unit-containers,...

How do i fix my S3/memcache latency problem?

We have SERIOUS latency issues SOMETIMES on our server. We store 3 things of interest in S3 and stuff them into memcache as well. User avatars averaging ~25k text ~1.5k xml ~1.5k we have dedicated 128meg of ram for memcached as of right now... as of right now it is riding 74 meg of it doing some basic math we should easily be able ...