项目作者: memcachier

项目描述 :
Rails example app for AWS Elastic Beanstalk
高级语言: Ruby
项目地址: git://github.com/memcachier/examples-rails-contacts.git
创建时间: 2019-05-06T14:41:11Z
项目社区:https://github.com/memcachier/examples-rails-contacts

开源协议:

下载


MemCachier Rails Elastic Beanstalk Tutorial App

This is an example Rails application that demonstrates the use of
caching using MemCachier on AWS Elastic
Beanstalk. This example is written with Rails 5.2.

You can read the full tutorial
here.

Setup MemCachier

Setting up MemCachier to work in Rails is very easy. You need to make
changes to Gemfile, production.rb, and any app code that you want
cached. These changes are covered in detail below.

Gemfile

MemCachier has been tested with the dalli memcache
client
. Add the following gem to
your Gemfile:

  1. gem 'dalli'

production.rb

Ensure that the following configuration option is set in production.rb:

  1. config.cache_store = :mem_cache_store,
  2. (ENV["MEMCACHIER_SERVERS"] || "").split(","),
  3. {:username => ENV["MEMCACHIER_USERNAME"],
  4. :password => ENV["MEMCACHIER_PASSWORD"],
  5. :failover => true,
  6. :socket_timeout => 1.5,
  7. :socket_failure_delay => 0.2,
  8. :down_retry_delay => 60
  9. }

Using MemCachier

In your application, use Rails.cache methods to access MemCachier.
A list of methods is available
here.
All the built-in Rails caching tools will work, too.

Get involved!

We are happy to receive bug reports, fixes, documentation enhancements,
and other improvements.

Please report bugs via the
github issue tracker.

Master git repository:

  • git clone git://github.com/memcachier/examples-rails-contacts.git

Licensing

This library is BSD-licensed.