Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[SS3.1] Memcached


Go to End


3 Posts   1698 Views

Avatar
Tony Air

Community Member, 13 Posts

16 February 2013 at 9:58pm

Hey, is there're a way to use one memcached server for a few websites?
Here's my config:

SS_Cache::add_backend('primary_memcached','Memcached',array(
	'host' => 'localhost',
	'port' => 11211,
	'persistent' => true,
	'weight' => 1,
	'timeout' => 5,
	'retry_interval' => 15,
	'status' => true,
	'failure_callback' => ''
));
SS_Cache::pick_backend('primary_memcached', 'any', 10);

The problem is that websites have the same cache_id_prefix for a different projects

Avatar
Van

Administrator, 25 Posts

18 February 2013 at 1:44pm

Hi Tony,

Unfortunately that is not possible at the moment. Your best option is probably to run multiple memchache Daemons.

Sorry I can't help more.

Avatar
Tony Air

Community Member, 13 Posts

20 February 2013 at 4:21am

Thank you for your answer Van.
In that way I suggest to change line #212 at the framework/cache/Cache.php from "$basicOptions = array('cache_id_prefix' => $for);" to "$basicOptions = array('cache_id_prefix' => md5($for.BASE_PATH));"