title: sharing Ehcache between two webapps
body: <p>I have 2 webapps, an admin webapp, and the actual application webapp itself. Both share access to a mysql store and Ehcache is used to cache the user details to prevent a user lookup hit to the backend per REST API request. </p>
  
  <p>The problem I have is that the admin app can be used (rarely I will add) to update the users credentials, lets say the password or username, or change some authorisation level etc. Now when this happens, I need the user cache to be invalidated, or cleared, so that the main webapp can then hit the db upon a user lookup to get the new users details into the cache. </p>
  
  <p>This currently happens, but the clearing of the cache is not visible to the main client webapp.</p>
  
  <p>How do I share a ehcache between two webapps (hosted both in jetty or tomcat)?? I am currently using Jetty but plan to switch to Tomcat. </p>
  
  <p>I am using Spring 3, Jersey, Hibernate, MySQL and Google Ehcache annotations. </p>
  
  <p>thanks for any assistance.</p>