Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8699071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:51:32+00:00 2026-06-13T01:51:32+00:00

Using Rails 3.1.1 on Heroku, Dalli & Memcachier. Production.rb config.cache_store = :dalli_store config.action_controller.perform_caching =

  • 0

Using Rails 3.1.1 on Heroku, Dalli & Memcachier.

Production.rb

  config.cache_store = :dalli_store 
  config.action_controller.perform_caching = true

Gemfile

  gem 'memcachier'
  gem 'dalli'

Controller#Show

unless fragment_exist?("gift-show--" + @gift.slug)
 # Perform complicated database query at 4-5 sec
end

View

<% cache('gift-show--' + @gift.slug, :expires_in => 3456000) do # 40 days %>
  # Create an HTML
<% end %>

Log output when a cached page is loaded

2012-10-17T03:15:43+00:00 app[web.2]: Started GET "/present/baka-kaka-set" for 23.20.90.66 at 2012-10-17 03:15:43 +0000
2012-10-17T03:15:43+00:00 app[web.2]: Could not find fragment for gift-show--baka-kaka-set # my log comment
2012-10-17T03:15:44+00:00 heroku[router]: GET www.mydomain.com/present/baka-kaka-set dyno=web.2 queue=0 wait=0ms service=195ms status=200 bytes=17167
2012-10-17T03:15:43+00:00 app[web.2]: cache: [GET /present/baka-kaka-set] miss
2012-10-17T03:15:43+00:00 app[web.2]:   Processing by GiftsController#show as */*
2012-10-17T03:15:43+00:00 app[web.2]:   Parameters: {"id"=>"baka-kaka-set"}
2012-10-17T03:15:43+00:00 app[web.2]: Exist fragment? views/gift-show--baka-kaka-set (1.5ms)
2012-10-17T03:15:43+00:00 app[web.2]: Read fragment views/gift-show--baka-kaka-set (1.5ms)
2012-10-17T03:15:43+00:00 app[web.2]: Write fragment views/gift-show--baka-kaka-set (4.0ms)

Each page is pretty much static once it has been created, thus the long expiry time (40 days).

If I load a page like this it seems to be written to the cache, I can verify that by reloading the page and see that it bypasses the controller (as I expect) and deliver the page quite fast.

My problem

The problem is that if I return to the page a few minutes later it has already been deleted from the cache! fragment_exist?('gift-show--gift-baka-kaka-set') returns false (so does Rails.cache.exist?('views/gift-show--gift-baka-kaka-set'))

I can see in the Memcachier analytics that the number of keys are decreasing. Even when I run a script that load each page (to create fragment caches) the number of keys in Memcachier does not increase in the same rate.

I am at about 34% of memory usage in Memcachier, so I am not close to the limit.

My questions

Am I doing something complete wrong? What should I rather do?

Could it be that I am writing to two different caches or something?

The last line in the log file confuses me a bit. It seems like that even after a fragment is read, a new one is still being written? Is that weird?

UPDATE 1: I realized I had commented out the line:

  # Set expire header of 30 days for static files
  config.static_cache_control = "public, max-age=2592000"

before. Could that have caused the problem? Are cached actions considered ‘static assets’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:51:33+00:00Added an answer on June 13, 2026 at 1:51 am

    Turned out to be a bug in Memcachier. Memcachier support came to this conclusion and it works fine with Memcache. Memcachier will try to fix the bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Rails, Heroku and the Dalli gem. If I type Rails.cache.stats in
Using: Rails 3.0.3 & Heroku & Execution Notifier & New Relic I get a
Using: Rails 3.0.3 & Heroku & Exception notifier & New Relic etc. I am
I am developing a Rails app using OmniAuth, OmniAuth-salesforce and this gem: https://github.com/heroku/databasedotcom I
Using: Rails 3.0.3. Webhost: Heroku.com. 2 dynos & 0 worker. I am a bit
I'm using a Rails blogging gem Enki on Heroku, but am having trouble posting
I'm using Rails on Heroku Cedar stack and it's not throwing any issues while
I just deployed my Rails app to Heroku, but the Javascripts that were using
I used Heroku in the past with Rails 3.0.9 using sqlite3 in development (locally).
I am trying to create a chat application on heroku using the following https://github.com/tarnfeld/PusherChat-Rails

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.