ぐぐらなくても雰囲気でできるレベル。herokuまたは俺すごい。
%brew install memcached
%memcached -vv
%heroku addons:add memcache:5mb//自分はherokuのGUIからインストールした
%heroku config
MEMCACHE_PASSWORD => password
MEMCACHE_SERVERS => server
MEMCACHE_USERNAME => user_name
myproject/conf/application.conf
memcached=enabled
memcached.host=MEMCACHE_SERVERS
memcached.user=MEMCACHE_USERNAME
memcached.password=MEMCACHE_PASSWORD
Application.scala
package controllers
import play.api.data.Form
import play.api.data.Forms.{single, nonEmptyText}
import play.api.mvc.{Action, Controller}
import anorm.NotAssigned
import play.api.cache.Cache
import play.api.cache.Cached
import play.api.Play.current
object Application extends Controller {
def index = Cached("home_page") {
Action {
Ok(views.html.index())
}
}
}