Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify configuration with an actual cache store #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fcheung
Copy link

@fcheung fcheung commented Apr 26, 2015

This allows one to do

config.cache_store = :dalli_elasticache_store, 'someendpoint.cfg.euw1.cache.amazonaws.com:11211', {:failover => true}

as suggested in #12

@ktheory
Copy link
Owner

ktheory commented May 31, 2015

@fcheung Looks great, thanks so much. 😄

Please add a test, and I'd be glad to merge this in.

cc @zmillman

@raghvendras73
Copy link

@fcheung Did this actually enable you to configure elasticache with the running EC2/Beanstalk instance? How do I confirm that this is working?

Thanks
Raghu

@fcheung
Copy link
Author

fcheung commented Oct 22, 2015

It does (sorry about not getting around to finishing it off. As far as confirming its working you could inspect Rails.cache in the console and also check that values are actually cached.

@raghvendras73
Copy link

Thanks.I will try and keep up posted.

Raghu

@raghvendras73
Copy link

@fcheung

I tried this change in production.rb and deploying to elastic beanstalk I get the following error in the console

[Instance: i-13ec4bdc] Command failed on instance. Return code: 1 Output: (TRUNCATED)...g/environment.rb:6:in <top (required)>' LoadError: cannot load such file -- active_support/cache/dalli_elasticache_store /var/app/ondeck/config/environment.rb:6:in<top (required)>' Tasks: TOP => environment (See full trace by running task with --trace). Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

Seems that dallI_elasticache_store is not loading, because of which deployment fails.

I went to console elastic-beanstalk and installed the gem dalli-elasticache, still no difference. Anything I may be missing?

Thanks
Raghu

@fcheung
Copy link
Author

fcheung commented Oct 23, 2015

It would also need to be in your Gemfile. We've been using this in production for some time now.

@raghvendras73
Copy link

@fcheung

It was there. Worked. Modified the config/initializers/session_store.rb for Rails >3.2.4 to put

Rails.application.config.session_store ActionDispatch::Session::CacheStore, :expire_after => 30.minutes

This did the trick.

Thanks for your help.

Raghu

@mattymess
Copy link

Would love to see this get merged. All you're waiting on are specs, @ktheory?

@ktheory
Copy link
Owner

ktheory commented Mar 4, 2016

@mattymess:

All you're waiting on are specs?

Yup, and would be nice to update the README too. Feel free to make an alternative PR if you'd like to pick this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants