title: Cache Following language PlayFramework 2 and ehcache
body: <p>I have a Play Framework 2 application with intertionalization.</p>
  
  <p>I use the CacheApi embedded in Play (ehCache) with standard configuration.
  I made an example with index page:</p>
  
  <pre><code>@Inject @NamedCache("session-cache") CacheApi cache;
  </code></pre>
  
  <p>then</p>
  
  <pre><code>@Cached(key = "index")
  public Result index() {
      //Controller.changeLang("fr");
  
      return ok(index.render(this.userProvider,"c-layout-header-fullscreen",NEWS_FORM));
  }
  </code></pre>
  
  <p>When i launch first page and refresh it seems to work but i have a method to change the lang (or detect automatically the browser lang/country)</p>
  
  <pre><code>public Result changeLanguage(String code) {
      Controller.changeLang(Language.findByCode(code).code);
      return redirect(controllers.routes.Application.index().toString());
  }
  </code></pre>
  
  <p>when i change the language the same page as before cached in first language page ordered is displayed.</p>
  
  <ol>
  <li><p>How i can specify the cache for a language (if i have 3 languages, 3 differents index page cached). Same problem for DB translation i want to chache result query but following the language it will be different. I want to cache the translation query because it will use DB lot of.</p></li>
  <li><p>what is difference between session-cache, db-cache, user-cache ? </p></li>
  </ol>