1
heroku에서 내 레일 앱에서 캐싱 액션을 사용하고 싶습니다. development.rb
에서 나는 설정 :dalli on heroku on 캐싱하지 않음
config.action_controller.perform_caching = true
및 로그
Started GET "..." for 127.0.0.1 at 2013-05-17 14:03:25 +0400
...
Write fragment ...
OR
Read fragment ... (0.2ms)
에서 볼 -> 생산으로 이동하려면 I 설치 memcache에 부가 $heroku addons:add memcache
를 통해, Gemfile의 새로운 보석 설치 : gem 'dalli'
을 변경할 설정 in production.rb
:
config.action_controller.perform_caching = true
config.cache_store = :dalli_store #, ENV['MEMCACHE_SERVERS'], { :namespace => 'myapp', :expires_in => 1.day, :compress => true }
나는이 두 통신을 가능하게하려고했습니다. 매개 변수를 ented, 어쨌든 나는 그 응용 프로그램이 인증됩니다 참조 로그에 Read/Write fragment ...
조각을 볼 수 없지만, 캐시는 항상 내가 캐시로드인지 확인 $heroku run console
실행
Started GET "..." for 195.178.108.38 at 2013-05-17 09:54:19 +0000
Dalli/SASL authenticating as myapp%40heroku.com
Dalli/SASL: Authenticated
cache: [GET ...] miss
누락되었습니다
irb(main):001:0> Rails.cache.read('color')
Dalli/SASL authenticating as myapp%40heroku.com
Dalli/SASL: Authenticated
=> nil
irb(main):002:0> Rails.cache.write('color', 'red')
=> true
irb(main):003:0> Rails.cache.read('color')
=> "red"
액션 캐싱이 작동하지 않는 이유는 무엇입니까?
Memcachier를 변경했지만 아무 것도 변경되지 않았습니다. 그러나 캐싱이 어떻게 든 작동하는 것으로 보입니다. 어쨌든, 고마워요) – xaxa
"내가 고쳤다."나는 추측한다. – catsby