title: Radiant and NewRelic with Memcached doesn't log traffic
body: <p>I've set up a Radiant instance using Memcached as the Radiant cache resource, however, it appears that cache hits aren't being logged to Radiant.</p>
  
  <p>Here's an example of the cache implementation:</p>
  
  <pre><code># file: :rails_root/config/environments/[RAILS_ENV].rb
  require 'dalli'
  $cache = Dalli::Client.new(["remotehost.com:11211", "127.0.0.1:11211"], :compress =&gt; true)
  config.middleware.use ::Radiant::Cache, :metastore =&gt; $cache, :entitystore =&gt; $cache
  </code></pre>
  
  <p>When I toss load at the Radiant instance (via httperf) only the cache misses are registered in NewRelic. </p>
  
  <p>::edit::</p>
  
  <p>Some things that might also be worth noting:</p>
  
  <ol>
  <li>I'm using nginx and unicorn.</li>
  <li><p>I'm currently requiring newrelic in <code>:rails_root/config.ru</code> like so:</p>
  
  <pre><code>begin
    require 'newrelic_rpm'
    NewRelic::Agent.after_fork(:force_reconnect =&gt; true)
  rescue LoadError
    # proceed without NewRelic
  end
  </code></pre></li>
  <li><p>I'm using bundler, here's a sample of my <code>Gemfile</code>:</p>
  
  <pre><code>source "http://my_gem_server"
  source :rubygems
  
  gem "radiant", "~&gt; 1.1.0"
  gem 'unicorn'
  gem 'therubyracer', '~&gt; 0.9'
  gem 'newrelic_rpm'
  gem 'rack-cache'
  gem 'dalli'
  gem "compass-rails", "~&gt; 1.0.3"
  group :extensions do
    # radiant extensions
    gem "radiant-archive-extension",             "~&gt; 1.0.7"
    gem "radiant-clipped-extension",             "~&gt; 1.1.0"
    gem "radiant-debug-extension",               "~&gt; 1.0.2"
    gem "radiant-exporter-extension",            "~&gt; 1.1.0"
    gem "radiant-markdown_filter-extension",     "~&gt; 1.0.2"
    gem "radiant-snippets-extension",            "~&gt; 1.1.0"
    gem "radiant-site_templates-extension",      "~&gt; 1.0.4"
    gem "radiant-smarty_pants_filter-extension", "~&gt; 1.0.2"
    gem "radiant-textile_filter-extension",      "~&gt; 1.0.4"
  
    # additional extensions
    gem "radiant-index_page-extension",          "~&gt; 1.0.1"
    gem "radiant-vapor-extension",               "~&gt; 2.1.4"
    gem "radiant-reorder_children-extension",    "~&gt; 1.0.6"
    gem "radiant-layouts-extension",             "~&gt; 1.1.3"
    gem "radiant-sibling_tags-extension",        "~&gt; 0.2.1"
    gem "radiant-if_param_tags-extension",       "~&gt; 1.0.1"
    gem "radiant-cache_buster-extension",        "~&gt; 0.0.1"
  
    # forked extensions
    gem "radiant-sheets-extension",              "1.1.0my1"
  end
  </code></pre></li>
  <li>Something I've tried:
  <ul>
  <li>Moving newrelic's require code to both the top and bottom of config.ru.</li>
  <li>Moving <code>gem "newrelic_rpm"</code> to the top and bottom of my Gemfile (bottom per: <a href="https://newrelic.com/docs/ruby/does-new-relic-work-with-the-bundler-gem" rel="nofollow">https://newrelic.com/docs/ruby/does-new-relic-work-with-the-bundler-gem</a>)</li>
  <li>Moving newrelic's require code to the bottom of my <code>:rails_root/config/enivornments/[RAILS_ENV].rb</code></li>
  <li>Moving newrelic's require code in to <code>:rails_env/config/boot.rb</code> and <code>:rails_env/config/environment.rb</code> -- both top and bottom.</li>
  <li>Requiring <code>newrelic_rpm</code> explicitly in the Gemfile with <code>gem "newrelic_rpm", :require =&gt; 'newrelic_rpm'</code></li>
  </ul></li>
  </ol>
  
  <p>::/edit::</p>
  
  <p>Anyone have any ideas?</p>
  
  <p>Thanks!</p>