From 96fff32ecf7a8b11a8f6184cf98dd72aa7be6ce5 Mon Sep 17 00:00:00 2001 From: Robert Oschwald Date: Tue, 18 Jun 2013 06:57:54 +0200 Subject: [PATCH 1/4] Removed explicit dependency to logging plugin - resubmitted patch originally by fterrier. See https://github.com/Grailsrocks/grails-cache-headers/pull/1/commits --- CacheHeadersGrailsPlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CacheHeadersGrailsPlugin.groovy b/CacheHeadersGrailsPlugin.groovy index bb7a1f6..e76a5c9 100644 --- a/CacheHeadersGrailsPlugin.groovy +++ b/CacheHeadersGrailsPlugin.groovy @@ -4,7 +4,7 @@ import groovy.util.ConfigObject class CacheHeadersGrailsPlugin { def version = "1.1.5" def grailsVersion = "1.2.0 > *" - def dependsOn = ['controllers':'1.1 > *', 'logging':'1.1 > *'] + def dependsOn = ['controllers':'1.1 > *'] def pluginExcludes = [ "grails-app/views/error.gsp", "grails-app/controllers/**" From a4f7648883da5367250a41f51324bbc6d17faaa8 Mon Sep 17 00:00:00 2001 From: Graeme Rocher Date: Tue, 18 Jun 2013 09:29:16 +0200 Subject: [PATCH 2/4] update to latest version of Grails, fix metadata --- CacheHeadersGrailsPlugin.groovy | 11 ++++++++--- application.properties | 4 +--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CacheHeadersGrailsPlugin.groovy b/CacheHeadersGrailsPlugin.groovy index e76a5c9..3c1486c 100644 --- a/CacheHeadersGrailsPlugin.groovy +++ b/CacheHeadersGrailsPlugin.groovy @@ -2,7 +2,7 @@ import org.codehaus.groovy.grails.commons.ConfigurationHolder import groovy.util.ConfigObject class CacheHeadersGrailsPlugin { - def version = "1.1.5" + def version = "1.1.6" def grailsVersion = "1.2.0 > *" def dependsOn = ['controllers':'1.1 > *'] def pluginExcludes = [ @@ -10,13 +10,18 @@ class CacheHeadersGrailsPlugin { "grails-app/controllers/**" ] - def author = "Marc Palmer" - def authorEmail = "marc@grailsrocks.com" + def author = "Graeme Rocher" + def authorEmail = "grocher@gopivotal.com" def title = "Caching Headers Plugin" def description = '''\\ Improve your application performance with browser caching, with easy ways to set caching headers in controller responses ''' + def developers = [ [ name: "Marc Palmer", email: "marc@grailsrocks.com" ], [ name: "Graeme Rocher", email: "grocher@gopivotal.com" ]] + def issueManagement = [ system: "JIRA", url: "http://jira.grails.org/browse/GPCACHEHEADERS" ] + def scm = [ url: "http://github.com/grails-plugins/grails-cache-headers" ] + def license = "APACHE" + def observe = ['controllers'] // URL to the plugin's documentation diff --git a/application.properties b/application.properties index 2781b17..a6ab1cc 100644 --- a/application.properties +++ b/application.properties @@ -1,6 +1,4 @@ #Grails Metadata file #Thu Apr 21 12:23:02 BST 2011 -app.grails.version=1.3.7 +app.grails.version=2.2.2 app.name=CacheHeaders -plugins.hibernate=1.3.7 -plugins.tomcat=1.3.7 From 8b039dd8c41ae0f784d1732ea9e753aac7c34170 Mon Sep 17 00:00:00 2001 From: graemerocher Date: Tue, 18 Jun 2013 12:18:50 +0200 Subject: [PATCH 3/4] Create README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7b82a9c --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +Grails Cache Headers Plugin +==================== + + +his plugin helps you Improve your application performance with browser caching, with easy ways to set caching headers in controller responses, and elegant ways to deal with ETag and Last-Modified generation and checking. +You can use this plugin to prevent caching of pages (eg forms), specify long term caching on infrequently changing content, and pass information to caching servers between the client and your app, and also to avoid regeneration of content if it has not changed since the client last downloaded it (even though the client may have an indication it has expired). + +See [the documentation](http://grails.org/plugin/cache-headers) for more information From 1859c9f8d6c74da758c35b5cc7f7c4021f68cc35 Mon Sep 17 00:00:00 2001 From: Rodrigo Rosenfeld Rosas Date: Thu, 10 Oct 2013 13:47:33 -0300 Subject: [PATCH 4/4] ConfigurationHolder is deprecated - supress warning message --- CacheHeadersGrailsPlugin.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CacheHeadersGrailsPlugin.groovy b/CacheHeadersGrailsPlugin.groovy index 3c1486c..9d83d4b 100644 --- a/CacheHeadersGrailsPlugin.groovy +++ b/CacheHeadersGrailsPlugin.groovy @@ -1,4 +1,3 @@ -import org.codehaus.groovy.grails.commons.ConfigurationHolder import groovy.util.ConfigObject class CacheHeadersGrailsPlugin { @@ -37,8 +36,8 @@ Improve your application performance with browser caching, with easy ways to set addCacheMethods(application, log) } - void reloadConfig(svc, log) { - def conf = ConfigurationHolder.config.cache.headers + void reloadConfig(application, svc, log) { + def conf = application.config.cache.headers def cacheSetting = conf.enabled svc.enabled = ((cacheSetting instanceof String) || (cacheSetting instanceof Boolean)) ? Boolean.valueOf(cacheSetting.toString()) : true svc.presets = conf.presets @@ -72,7 +71,7 @@ Improve your application performance with browser caching, with easy ways to set def doWithApplicationContext = { applicationContext -> def svc = applicationContext.cacheHeadersService - reloadConfig(svc, log) + reloadConfig(application, svc, log) } def onChange = { event -> @@ -82,6 +81,6 @@ Improve your application performance with browser caching, with easy ways to set def onConfigChange = { event -> // Config change might mean that the caching has been turned on/off def svc = event.application.mainContext.cacheHeadersService - reloadConfig(svc, log) + reloadConfig(event.application, svc, log) } }