memcachedã®ãã£ãã·ã¥ãã¼ã«sha1ãmd5ã®hashå¤ã使ãã¨tcpdumpã解æãã¼ã«ã§è¦ãã«ãããªãã®ã§ãcacheã«ã¯åºæ¥ãã ãããããããååãã¤ãã¦ä¸ãããã¨ããããã· ä¸ã®ãããªã³ã¼ãã®ããã« sub cache { state $cache = Cache::Memcached::Fast->new({ namespace => 'db:', }); } sub key { my ($self,$key) = @_; sha1_hex($key); } sub cached_member { my ($self, $member_id) = @_; my $key = $self->key('member:'.$member_id); my $member = $self->cache->get($key); if ( !$member ) { #DBããåå¾ }
{{#tags}}- {{label}}
{{/tags}}