memcached

Cache a django view that has URL parameters.

I have recently implemented Django's excellent cache framework. However from what I understand Django will not cache a view that is passed parameters in a get request. I have an Ajax view that is passed get parameters that I would like to cache for X seconds, what would be an easy way to do this? In psuedo code I currently have a URL: ...

memcache and wildcards

I'm just wondering if there is a way to clear memcache using wildcards for key values. So say I have a cache with the key "1234~foo" and another "1234~foo~bar". Is there any way I can say clear the cache by using something like clear("1234*") and have it clear both from above? I hope that makes sense. Thanks. ...

Site wide caching with Django - problems with password protected pages on logout

I've recently implemented sitewide caching using memcached on my Django application, I've set the TTL to about 500 seconds, and implement per view caches on other parts of the web application. The problem I have is that when a user logs out, because it's a form post the site behaves as expected, however if they then go to a password pro...

Memcached, Locking and Race Conditions

Hi, We are trying to update memcached objects when we write to the database to avoid having to read them from database after inserts/updates. For our forum post object we have a ViewCount field containing the number of times a post is viewed. We are afraid that we are introducing a race condition by updating the memcached object, as t...

Memcached .NET Clients Comparisons

Hi, I'm looking for a .NET Memcached Client, I founded 3 clients libraries. Anyone have pros and cons about theses clients ? MemcachedDotNet BeIT Enyim Thanks. ...

Setting an object in the Django cache API fails due to pickle error

I'm trying to manually set an object in the Django cache API but it fails (i think due to pickling?) The object is given to me by a third party, my code is: def index(request, template_name="mytemplate.htm"): user_list = cache.get("user_list_ds") if user_list is None: # this is the expensive bit I'm trying to cache ...

Which key:value store to use with Python?

So I'm looking at various key:value (where value is either strictly a single value or possibly an object) stores for use with Python, and have found a few promising ones. I have no specific requirement as of yet because I am in the evaluation phase. I'm looking for what's good, what's bad, what are the corner cases these things handle we...

In Django, how to clear all the memcached keys and values?

I don't want to restart the memcached server! ...

Multiple sets in memcached / compatible software?

Hi all, Is there a way to set multiple ways to a memcached instance? Just like we are doing with multiple keys performing multiget. So my preferences are for this operation to be a just hellfast, I would survive if it won't be atomic, though. AFAIK, Redis can do a similar stuff, but I'm not sure if that's what I need. What you you sug...

Is there a memcache "catalog"?

Hi there we're using memcache in several of our Rails applications. Now I was wondering: Is there a way to get a list of all objects stored in memcache including the amount of data each value occupies? E.g.: key | memory(Bytes) | % ----------------------------------- foo_key | 15013 | 0.3 bar_key | 2201 ...

template fragment caching doesn't seem to work for some custom template tags

I've been implementing caching in my django application, and used per view caching via the cache API and template fragment caching. On some of my pages I use a custom django template tag, this tag is provided via a third party developer, it takes some arguments in its template tags, and then make a request to a remote server, gets the re...

Extending ASP.NET data cache to be shared across web farm

I have an ASP.NET application that makes extensive use of ASP.NET cache API for caching commonly-used data. In addition, I am using polling-based sql cache dependency to track expiration. The drawback of the current design is that, in the web farm environment, each web server has its own data cache that is not shared across servers. Is...

Memcache stats cachedump

We have found that with our memcache some keys tend to be lost. To debug, I am using the command stats cachedump <slab> <limit> The output is something like this : ITEM key-stuff-123-mlgtr-tmura [58 b; 1256946310 s] ITEM key-stuff-123-mlgtr-isuca [58 b; 1256946310 s] ITEM key-stuff-123-mlgtr-arpan [58 b; 1256946310 s] ITEM key-stuff-12...

How to use JCache in Scala? I get compiler type error: found String required K

I'm learning Scala and trying to use javax.cache in Scala code and can't find how to solve this problem: val cacheFactory = CacheManager.getInstance.getCacheFactory val map = new HashMap val cache = cacheFactory.createCache(map) def rawSet(key:String, value:Array[Byte]) { cache.put(key, value) } and the compiler error is: er...

writing memcached connection using pecl based memcached extension

I am actually thinking to start using memcached in my php code, http://us3.php.net/manual/en/book.memcached.php while I searched in google, I find memcache based examples, but not much about memcached based connection and other examples. it will be really helpful, if someone can share procedural way of writing memcached connection for...

Will memcache help with expensive MySQL queries? (Drupal site)

Hello all, this is a simple question. There are some queries on our site that take too many seconds to complete (like 15 seconds!). For anonymous traffic they get a cached .html file, but for logged in users it's too slow. The query looks like this: SELECT node.nid, votingapi_cache_vote_percent_average.value AS votingapi_cache_vote_...

accessing memcached stats via cmemcache or django returns warning

Hi, My Django application uses memcached via cmemcache. An issue sprung up when I was trying to monitor its usage: I tried to access stats memcached provides through both Django and cmemcache: django: from django.core.cache import cache cache._cache.get_stats() [[email protected]] mcm_server_stats():3027: unknown stat variable: ...

Memcache service is down - how to handle?

I am using Memcache in my ASP.NET application. I have 3 memcache servers that it connects to. If all of them are down, there is a significant delay in loading the pages. When all servers are down, I would want to not use memcache. When I was stepping through the code, I noticed that when the servers are down, memcache code does not thro...

PHP - Memcache - HTML Caching

Hi, I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page content is same for every user. So in this case I can either: a) create an HTML page, and that page can be generated every hour. In ...

How do I see if memcached is already running on my chosen port?

I am having some problems with memcached and one idea I am having is that perhaps it is already running on the port I am trying to run it on, started by some other user on our network. Is there a way to tell what memcached ports are currently in use? ...