Cache plugin - grails/grails-core GitHub Wiki

A new cache plugin is being developed. This document aims to cover some of the goals and high level details of the plugin.

Goals

The plugin should support basic Grails web app caching use cases including:

  • Method level cache on services
  • Content level cache on controller actions
  • Tag library cache

The plugin should be implementation independent. There will be impl plugins to support gemfire, ehcache and others.

Some Implementation Notes

The plugin will build on the cache abstraction API provided by Spring 3.1 and will use annotations provided by that API.

The plugin should provide a DSL for configuring caches. The DSL should be constructed such that if a particular implementation does not support a particular configuration option the system should log warning messages but as much as is practical should continue to function. The details of this configuration DSL still need to be defined and explored.

There will be a core cache plugin and then separate plugins which support specific implementations (grails-cache, grails-cache-gemfire, grails-cache-ehcache, etc...). We need to make a decision about the default implementation that will be supported by the main grails-cache plugin. Some reasonable options are for the main plugin to use an LRU Map or ehcache.

Dashboard / Admin Support

A plugin or set of plugins should be developed to provide dashboard and administration capabilities. This might include a browser dashboard which displays cache statistics and allows the manipulation of caches. This might also include some sort of interface (REST and/or other) that supports some of that same functionality from scripts or desktop applications.