Skip to content

The grails plugin provides possibility to use Spring Cache together with Hibernate L2 cache and EHCache

License

Notifications You must be signed in to change notification settings

purpleraven/grails-cows-cache-plugin

Repository files navigation

grails-cows-cache-plugin

Download

The plugin provides possibility to use Spring Cache together with Hibernate L2 cache and EHCache

Grails 4 & 3.3 supported

Usage

Interesting things:

  • Provided SimpleCacheKeyGenerator can be used as Spring customCacheKeyGenerator
  • CowsDBService has method for direct sql quering inside current Hibernate transaction: sqlUpdate, sqlExecute, sqlFirstRow, sqlEachRow, sqlRows
  • The plugin includes EHCache administrative UI with cache size manipulation possibilities and listing cache content (/adminCache/index)

configuration content

Installation

Add the following dependencies in build.gradle

repositories {
...
  maven { url "http:https://dl.bintray.com/purpleraven/plugins" }
...
}
dependencies {
...
    compile 'org.grails.plugins:grails-cows-cache-plugin:2.1'
...
}

Add following spring security configuration runtime.groovy to protect UI from access

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
    [pattern: '/adminCache/**', access:["hasAuthority('YOUR_ADMIN_PERMISSION')"]]
]

Add customCacheKeyGenerator(SimpleCacheKeyGenerator) in resource.groovy (optional)

ehcache.xml can be placed in grails-app/conf directory

License

Apache 2

About

The grails plugin provides possibility to use Spring Cache together with Hibernate L2 cache and EHCache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages