Trying to great MemCached like a SESSION array

hi. can someone help in what i’m doing wrong?

i just want to treat this CACHE as if it were a session / variable that
was an array.

def test
CACHE[:test] = []
an_array = %w{ foo bar baz}
an_array.each { |i| CACHE[:test] << i }

Now in Views, when i simply pull out of the array:
<% CACHE[:test].each do |i| %>
<%= i %>

<%end %>

I’d expect to see:

My cache is up and running. What am i doing wrong?

(My environment.rb for the cache is standard:
require ‘memcache’

memcache_options = {
:c_threshold => 10_000,
:compression => true,
:debug => false,
:namespace => ‘’,
:readonly => false,
:urlencode => false }

CACHE = memcache_options
CACHE.servers = ‘localhost:11211’)

Thanks in advance…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs