I have a memcached daemon set up with Webfaction, and it works great. When i want to reset the cache, I kill the process as described in the webfaction memecached guide: http://docs.webfaction.com/software/memcached.html#memcached-setting-up I would like to use memcached with multiple sites, but am not sure what the best solution is for that. Obviously if it's all stored within the same daemon, killing that process would affect all sites. On the other hand, i'm not sure sporing multiple daemons would be particularly efficient. I could: a) Write some logic to prevent conflicts and enable easy reset of site specific cache (e.g. store all site cache within a variable identifying that site) b) Use a different memcached daemon for each site (is this even possible with the way memcached is set up on webfaction?) c) ? asked 08 Nov '11, 05:51 alz |
Hi, You should be able to run multiple instances of memcached for each of your Django sites that you want to use it with. Writing some logic to prevent conflicts might also be possible, although I haven't personally seen this done before. answered 08 Nov '11, 05:59 todork |
Hi, Old question, but I think settings KEY_PREFIX is the way to achieve having multiple sites use the same memcached instance: https://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs#cache-key-prefixing answered 30 Nov '12, 11:22 fonso |