Jump to:

22999 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » [SS3.1] Memcached

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

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

Page: 1
Go to End
Author Topic: 383 Views
  • Tony Air
    Avatar
    Community Member
    13 Posts

    [SS3.1] Memcached Link to this post

    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

  • Van
    Avatar
    Administrator
    25 Posts

    Re: [SS3.1] Memcached Link to this post

    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.

  • Tony Air
    Avatar
    Community Member
    13 Posts

    Re: [SS3.1] Memcached Link to this post

    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));"

    383 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.