Heroku Rails 3 Rails.cache.class reports ActiveSupport::Cache::FileStore after I call Rails.application.config.cache_store = :redis_store, “#{ur

Category : Network & Servers

Where url=redis://redistogo:XXXYYYZZZ@cod.redistogo.com:9362/

This is called in my initializer code.

Here is the other pertinent config options:

1) in production.rb

config.action_controller.perform_caching = true in my production.rb

2) In my controller:

caches_action :show, :layout => false, :if => Proc.new {|c| c.request.query_string.blank?}
caches_page :get_session_info

3) in the initializer:

Rails.application.config.cache_store = :redis_store, "#{url}"

View Replies

Related to : Heroku Rails 3 Rails.cache.class reports ActiveSupport::Cache::FileStore after I call Rails.application.config.cache_store = :redis_store, “#{ur

redis cache store in rails
Category : Network & Servers
Rails.cache.write(key, :expires_in => 1.hour) do
:segment_ids => [1,2,3,4,6]

Logger.info always print nil

@in_use_details = Rails.cache.fe

View Replies

My rails app's redis cache on Heroku
Category : Programming Languages

I am trying to use Redis on Heroku.

I set like the following on initialiers.

redis_url = ENV["REDISTOGO_URL"] || "redis://"
RedisApp::Application.config.cache_store = :redis_store, redis_url
RedisApp::Application.config.session_store :red

View Replies

Rails.cache throws “marshal dump” error when changed from memory store to memcached store
Category : Programming Languages

If I set this in my environment

config.action_controller.cache_store = :mem_cache_store

ActionController::Base.cache_store will use a memcached store but Rails.cache will use a memory store instead:

$ ./script/console
>> A

View Replies

rails fragment cache store
Category : Programming Languages

I am unable to figure out where my cached fragments are being stored. What is the default location for fragment caching.

Cached fragment hit: views/listed_products (0.1ms)

I cannot find anything in the rails_root/public or rails_root/tmp/cache dirs

View Replies

Is ActiveSupport::Cache::MemoryStore cleared up rails restart with Passenger?
Category : Programming Languages

I am pretty sure it does, but I wanted to double check, since I don't know exactly how Passenger restarts a rails app. So if I have something like:

Rails.cache.fetch(:my_obj) { MyObj.first }

will all the cache be cleared upon restart (which is my hope)?

View Replies

rails cache to redis nested models
Category : Network & Servers

Is it possible to easy save Foo.includes(:bar).all to redis?

class Foo < ActiveRecord::Base
has_and_belongs_to_many :bars
class Bar < ActiveRecord::Base
has_and_belongs_to_many :foos


View Replies

How can I clear rails cache after deploy to heroku?
Category : Network & Servers

I applied cache to my heroku rails app and it works well.
But everytime I deploy to heroku, I also want to clear cache automatically.

so I googled and I found this.

task :after_deploy, :env, :branch do |t, args|
puts "Deployment Complete"
puts "Cle

View Replies

Rails.cache and un-dumpable (Marshal) structures: how to cache? (on the example flickraw-response)
Category : Network & Servers

i want to Rails.cache a flickraw response (this is applicable to other un-dumpable structures as well) with memcached as follows:

@flickr = Rails.cache.fetch('flickr_sets', :expires_in => 1) { flickr.photos.getRecent }

the obvious error is


View Replies

Cache strategy for rails where new objects appearing invalidates the cache
Category : Network & Servers

I'm not seeing something obvious re:caching strategies in rails.

I have a prices table that logs prices at particular times. So the current price would be the last row added to the prices table. Very frequently, the table is queried to display the entries, so caching that fetching wou

View Replies

Rails 3 - Store and open pdf files in Rails directory when using Heroku
Category : Web Design

I need to use some pdf files for my Rails app. As they're few and not very heavy, I'm keeping them in my Rails app directory. For example, if 1.pdf file is in Rails root, I use open("#{Rails.root}/1.pdf") to open it. This works locally, but when I push to Heroku, all pdf files get ig

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .