Skip to content

Commit 19efee4

Browse files
committed
Update docs
- Migrate to Grace - Add changelog for version 6.x
1 parent 778303b commit 19efee4

File tree

11 files changed

+309
-88
lines changed

11 files changed

+309
-88
lines changed

gradle.properties

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,3 @@ chromeDriverVersion=126.0.6478.126
1313
geckodriverVersion=0.33.0
1414
seleniumVersion=4.2.2
1515
webdriverBinariesVersion=3.2
16-
asciidoc=true
17-
githubSlug=graceframework/grace-cache
18-
githubBranch=master
19-
title=Cache Plugin
20-
projectDesc=Provides AST transformations for caching method calls
21-
guide=../../guide
22-
projectUrl=https://github.com/graceframework/grace-cache
23-
developers=Michael Yan

src/main/docs/guide/implementation.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ All of the plugin's classes are designed for extensibility; the classes are all
22

33
== Cache manager
44

5-
65
The core cache plugin registers a `grailsCacheManager` Spring bean, and the extension plugins replace this bean with one that creates and manages caches for that implementation. The default implementation is an instance of link:{api}/grails/plugin/cache/GrailsConcurrentMapCacheManager.html[GrailsConcurrentMapCacheManager] which uses link:{api}/grails/plugin/cache/GrailsConcurrentMapCache.html[GrailsConcurrentMapCache] as its cache implementation. It uses a `java.util.concurrent.ConcurrentHashMap` to store cached values.
76

87
You can customize the cache manager by replacing the `grailsCacheManager` Spring bean in `resources.groovy` with your own; either subclass link:{api}/grails/plugin/cache/GrailsConcurrentMapCacheManager.html[GrailsConcurrentMapCacheManager] (e.g. to override the `createConcurrentMapCache()` method) or by implementing the link:{api}/org/grails/plugin/cache/GrailsCacheManager.html[GrailsCacheManager] interface.
98

109
=== Fragment caching
1110

12-
1311
You can cache partial GSP page sections with the `<cache:block>` tag. You can specify a key when using this tag but it's in general unnecessary. This is because the block will be rendered with its own Closure, and the default key is the full closure class name. This is unique since the closures aren't re-used; for example these two blocks will be cached independently, even in the same GSP:
1412

1513
[source,groovy]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
The Grails Cache plugin provides powerful and easy to use caching functionality to Grails applications and plugins.
1+
Grace Cache plugin provides powerful and easy to use caching functionality to Grace applications and plugins.
22

3-
IMPORTANT: Cache version 4.0.0 and higher requires GORM 6.1.x or higher
Lines changed: 289 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,290 @@
1-
[[changeLog]]
2-
=== Change log
3-
41
For recent versions please check the https://github.com/graceframework/grace-cache/releases[release notes].
2+
3+
=== 6.3.0-RC1
4+
5+
https://github.com/graceframework/grace-cache/releases/tag/v6.3.0-RC1[release notes]
6+
7+
🛠 Improvements
8+
9+
* Update README Update badge versions of Grace, Groovy and Spring Boot
10+
* Streamline Gradle build scripts: using the Spring Dependency Management Plugin to manage dependencies and versions link:{issues}/54[#54]
11+
* Remove the unnecessary workaround for removing the generated extra dependencyManagement of POM link:{issues}/53[#53]
12+
13+
🚀 Dependency Upgrades
14+
15+
* Upgrade to Grace 2023.3.0-M2 link:{issues}/48[#48]
16+
* Upgrade to Grace Data 2023.3.0-RC1 link:{issues}/49[#49]
17+
* Upgrade to Groovy 4.0.26 link:{issues}/50[#50]
18+
* Upgrade to Java Parser 3.26.4 link:{issues}/51[#51]
19+
* Upgrade to Spring Boot 3.3.10 link:{issues}/52[#52]
20+
21+
⚙️ Tasks
22+
23+
* Release v6.3.0-RC1
24+
* build: update GitHub workflows
25+
26+
=== 6.3.0-M1
27+
28+
https://github.com/graceframework/grace-cache/releases/tag/v6.3.0-M1[release notes]
29+
30+
🛠 Improvements
31+
32+
* Update README
33+
* Update github workflows Switch to 6.3.x branch
34+
35+
🚀 Dependency Upgrades
36+
37+
* Upgrade to AssertJ 3.25.3 link:{issues}/45[#45]
38+
* Upgrade to CGLib Nodep 3.3.0 link:{issues}/46[#46]
39+
* Upgrade to Grace 2023.3.0-M1 link:{issues}/43[#43]
40+
* Upgrade to Grace Data 2023.3.0-M1 link:{issues}/47[#47]
41+
* Upgrade to Spring Boot 3.3.7 link:{issues}/44[#44]
42+
43+
⚙️ Tasks
44+
45+
* Release v6.3.0-M1
46+
* Set version to 6.3.0-SNAPSHOT
47+
48+
=== 6.2.0
49+
50+
https://github.com/graceframework/grace-cache/releases/tag/v6.2.0[release notes]
51+
52+
🛠 Improvements
53+
54+
* Update README
55+
* Add GitHub issue template link:{issues}/40[#40]
56+
* Update build scripts to avoid deprecation warnings with Gradle 8 link:{issues}/39[#39]
57+
58+
🚀 Dependency Upgrades
59+
60+
* Upgrade to Grace 2023.2.0-RC1 link:{issues}/38[#38]
61+
* Upgrade to Grace Data 2023.2.0 link:{issues}/41[#41]
62+
63+
⚙️ Tasks
64+
65+
* Release v6.2.0
66+
67+
=== 6.2.0-RC1
68+
69+
https://github.com/graceframework/grace-cache/releases/tag/v6.2.0-RC1[release notes]
70+
71+
🛠 Improvements
72+
73+
* Excludes demo classes in plugin jar link:{issues}/37[#37]
74+
75+
🚀 Dependency Upgrades
76+
77+
* Upgrade to Grace 2023.2.0-M3 link:{issues}/35[#35]
78+
* Upgrade to Grace 2023.2.0-M2 link:{issues}/33[#33]
79+
* Upgrade to Grace Data 2023.2.0-RC1 link:{issues}/34[#34]
80+
* Upgrade to Gradle 8.12 link:{issues}/36[#36]
81+
82+
⚙️ Tasks
83+
84+
* Release v6.2.0-RC1
85+
86+
=== 6.2.0-M1
87+
88+
https://github.com/graceframework/grace-cache/releases/tag/v6.2.0-M1[release notes]
89+
90+
🛠 Improvements
91+
92+
* Update README Update badge of Grace to current version
93+
* Update github workflows
94+
95+
🚀 Dependency Upgrades
96+
97+
* Upgrade to Grace 2023.2.0-M1 link:{issues}/28[#28]
98+
* Upgrade to Grace Data 2023.2.0-M1 link:{issues}/32[#32]
99+
* Upgrade to JUnit Jupiter 5.10.5 link:{issues}/30[#30]
100+
* Upgrade to JUnit Platform 1.10.5 link:{issues}/31[#31]
101+
* Upgrade to Spring Boot 3.2.12 link:{issues}/29[#29]
102+
103+
⚙️ Tasks
104+
105+
* Release v6.2.0-M1
106+
* Set version to 6.2.0-SNAPSHOT
107+
108+
=== 6.1.0
109+
110+
https://github.com/graceframework/grace-cache/releases/tag/v6.1.0[release notes]
111+
112+
🛠 Improvements
113+
114+
* Update Badges
115+
* Use Java 17 toolchain link:{issues}/26[#26]
116+
117+
⚙️ Tasks
118+
119+
* Release v6.1.0
120+
121+
🚀 Dependency Upgrades
122+
123+
* Upgrade to Grace 2023.1.0-RC1 link:{issues}/23[#23]
124+
* Upgrade to Grace Data 2023.1.0 link:{issues}/24[#24]
125+
* Upgrade to Groovy 4.0.24 link:{issues}/25[#25]
126+
127+
=== 6.1.0-RC1
128+
129+
https://github.com/graceframework/grace-cache/releases/tag/v6.1.0-RC1[release notes]
130+
131+
🛠 Improvements
132+
133+
* Use `classesDirectory` property instead of deprecated `outputDir` link:{issues}/22[#22]
134+
* Add dependency `jakarta.annotation-api` explicitly link:{issues}/20[#20]
135+
* Update build scripts
136+
137+
🚀 Dependency Upgrades
138+
139+
* Upgrade to Grace 2023.1.0-M3 link:{issues}/18[#18]
140+
* Upgrade to Grace Data 2023.1.0-RC1 link:{issues}/19[#19]
141+
* Upgrade to Gradle Nexus Publish Plugin 2.0.0 link:{issues}/21[#21]
142+
143+
⚙️ Tasks
144+
145+
* Release v6.1.0-RC1
146+
147+
=== 6.1.0-M3
148+
149+
https://github.com/graceframework/grace-cache/releases/tag/v6.1.0-M3[release notes]
150+
151+
🛠 Improvements
152+
153+
* Generate Spring Boot configuration metadata file link:{issues}/16[#16]
154+
155+
🚀 Dependency Upgrades
156+
157+
* Upgrade to Grace 2023.1.0-M2 link:{issues}/15[#15]
158+
* Upgrade to Grace Data 2023.1.0-M3 link:{issues}/17[#17]
159+
160+
⚙️ Tasks
161+
162+
* Release v6.1.0-M3
163+
164+
=== 6.1.0-M2
165+
166+
https://github.com/graceframework/grace-cache/releases/tag/v6.1.0-M2[release notes]
167+
168+
🛠 Improvements
169+
170+
* Enable `CacheProperties` to generate metadata Use Java rewriting and renaming `CachePluginConfiguration` to `CacheProperties` link:{issues}/14[#14]
171+
* Update meta info of Cache plugin link:{issues}/13[#13]
172+
* Use `ClearCachesApplicationListener` replace of `Plugin.doWithApplicationContext` link:{issues}/12[#12]
173+
* Update README
174+
* Enable Unit Tests link:{issues}/10[#10]
175+
* Auto-Configure Cache Plugin link:{issues}/7[#7]
176+
177+
🚀 Dependency Upgrades
178+
179+
* Upgrade to Grace 2023.1.0-M1 link:{issues}/3[#3]
180+
* Upgrade to Grace Data 2023.1.0-M2 link:{issues}/11[#11]
181+
* Upgrade to Jansi 2.4.0 link:{issues}/4[#4]
182+
* Upgrade to Java Parser 3.26.2 link:{issues}/5[#5]
183+
* Upgrade to Javassist 3.30.2-GA link:{issues}/6[#6]
184+
* Upgrade to Selenium 4.2.2 link:{issues}/9[#9]
185+
* Upgrade to Webdriver Binaries Gradle Plugin 3.2 link:{issues}/8[#8]
186+
187+
⚙️ Tasks
188+
189+
* Release v6.1.0-M2
190+
191+
=== 6.1.0-M1
192+
193+
https://github.com/graceframework/grace-cache/releases/tag/v6.1.0-M1[release notes]
194+
195+
🛠 Improvements
196+
197+
* Update README
198+
* Update README
199+
* Update README
200+
201+
🚀 Dependency Upgrades
202+
203+
* Upgrade to Grace 2023.0.2
204+
* Upgrade to Groovy 4.0.23
205+
* Upgrade to GORM 2023.1.0-M1 link:{issues}/2[#2]
206+
207+
⚙️ Tasks
208+
209+
* Release v6.1.0-M1
210+
* Update github workflows
211+
* Set version to 6.1.0-SNAPSHOT
212+
213+
=== 6.0.1
214+
215+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.1[release notes]
216+
217+
* Release v6.0.1
218+
* Upgrade to Grace Geb Plugin 6.0.1
219+
* Upgrade to GORM 2023.0.1
220+
* Upgrade to Grace 2023.0.0
221+
* Set version to 6.0.1-SNAPSHOT
222+
223+
=== 6.0.0
224+
225+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.0[release notes]
226+
227+
* Release v6.0.0
228+
* Upgrade to Grace Geb Plugin 6.0.0
229+
* Upgrade to GORM 2023.0.0
230+
* Upgrade to Groovy 4.0.22
231+
* Upgrade to Grace 2023.0.0-RC2
232+
233+
=== 6.0.0-RC1
234+
235+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.0-RC1[release notes]
236+
237+
* Release v6.0.0-RC1
238+
* Upgrade to Grace Geb Plugin 6.0.0-RC1
239+
* Upgrade to GORM 2023.0.0-RC1
240+
* Upgrade to Gradle Wrapper 7.6.4
241+
* Upgrade to Groovy 4.0.21
242+
* Upgrade to Grace 2023.0.0-M7
243+
* Remove unused grailsw
244+
* Set `archiveClassifier` with 'plugin'
245+
* Update github workflows
246+
* Back to 6.0.0-SNAPSHOT
247+
248+
=== 6.0.0-M3
249+
250+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.0-M3[release notes]
251+
252+
* Release v6.0.0-M3
253+
* Upgrade to Grace Geb Plugin 6.0.0-M2
254+
* Add artifact `grails-plugin.xml`
255+
* Upgrade to Grace GORM 2023.0.0-M5
256+
* Upgrade to Grace 2023.0.0-M6
257+
* Grace: update github workflows
258+
* Grace: migrate to grace
259+
* Upgrade to Groovy 4.0.12
260+
261+
=== 6.0.0-M2
262+
263+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.0-M2[release notes]
264+
265+
* Release v6.0.0-M2
266+
* Upgrade to Grace Geb Plugin 6.0.0-M1
267+
* Upgrade to Grace Data 2023.0.0-M4
268+
* Upgrade to Grace 2023.0.0-M5
269+
* Grace: update github workflows
270+
* Grace: migrate to grace
271+
* Adding spockVersion in gradle.properties
272+
* Back to Snapshots
273+
274+
=== 6.0.0-M1
275+
276+
https://github.com/graceframework/grace-cache/releases/tag/v6.0.0-M1[release notes]
277+
278+
* Grace: update github workflows
279+
* Update plugin info
280+
* Grace: update build scripts
281+
* Configure spockVersion property
282+
* Grace: update github workflows
283+
* Grace: update build scripts
284+
* Upgrade to Groovy 4.0.11
285+
* Upgrade to Grace GORM 2023.0.0-M2
286+
* Upgrade to Grace 2023.0.0-M2
287+
* Grace: migrate to grace
288+
* Migrate to Jakarta: Jakarta Servlet 6.0.0
289+
* Force to use Groovy 4
290+
* Build target to Java 17

src/main/docs/guide/usage.adoc

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
The cache plugin adds Spring bean method call, GSP page fragment and
2-
template caching to Grails applications. You configure one or more caches
3-
in `grails-app/conf/application.yml`, and
4-
annotate methods (either in Spring beans (typically Grails services)) to be cached.
5-
You can also wrap GSP sections in cache tags and render cached templates.
1+
The cache plugin adds Spring bean method call, GSP page fragment and template caching to Grace applications. You configure one or more caches in `app/conf/application.yml`, and annotate methods (either in Spring beans (typically Grace services)) to be cached. You can also wrap GSP sections in cache tags and render cached templates.
62

7-
There are three annotations; link:{api}/grails/plugin/cache/Cacheable.html[Cacheable],
8-
link:{api}/grails/plugin/cache/CachePut.html[CachePut],
9-
and link:{api}/grails/plugin/cache/CacheEvict.html[CacheEvict]. You use
10-
`Cacheable` to mark a method as one that should check the cache for a
11-
pre-existing result, or generate a new result and cache it. Use `CachePut` to
12-
mark a method as one that should always be evaluated and store its result in the
13-
cache regardless of existing cache values. And use `@CacheEvict` to flush a cache
14-
(either fully or partially) to force the re-evaluation of previously cached
15-
results.
3+
There are three annotations; link:{api}/grails/plugin/cache/Cacheable.html[Cacheable], link:{api}/grails/plugin/cache/CachePut.html[CachePut], and link:{api}/grails/plugin/cache/CacheEvict.html[CacheEvict]. You use `Cacheable` to mark a method as one that should check the cache for a pre-existing result, or generate a new result and cache it. Use `CachePut` to mark a method as one that should always be evaluated and store its result in the cache regardless of existing cache values. And use `@CacheEvict` to flush a cache (either fully or partially) to force the re-evaluation of previously cached results.
164

17-
When using distributed caching (such as ehcache with distributed cache enabled,
18-
or redis with multiple instances of the application running against one redis
19-
instance), all classes that use annotation caching or XML caching should
20-
override the `hashCode` method. The hash code of the object with the method
21-
marked as being cacheable is included in the cache key, and the default
22-
`hashCode` implementation will vary each time the application is run. Overriding
23-
`hashCode` ensures that each instance of the applications will appropriately
24-
share cache keys.
5+
When using distributed caching (such as ehcache with distributed cache enabled, or redis with multiple instances of the application running against one redis instance), all classes that use annotation caching or XML caching should override the `hashCode` method. The hash code of the object with the method marked as being cacheable is included in the cache key, and the default `hashCode` implementation will vary each time the application is run. Overriding `hashCode` ensures that each instance of the applications will appropriately share cache keys.
256

26-
This 'core' cache plugin uses an in-memory implementation where the caches and
27-
cache manager are backed by a thread-safe `java.util.concurrent.ConcurrentMap`.
28-
This is fine for testing and possibly for low-traffic sites, but you should
29-
consider using one of the extension plugins if you need clustering, disk
30-
storage, persistence between restarts, and more configurability of features like
31-
time-to-live, maximum cache size, etc. Currently the only extension plugin available for Grails 3 is https://plugins.grails.org/plugin/grails/cache-ehcache[cache-ehcache].
7+
This 'core' cache plugin uses an in-memory implementation where the caches and cache manager are backed by a thread-safe `java.util.concurrent.ConcurrentMap`. This is fine for testing and possibly for low-traffic sites, but you should consider using one of the extension plugins if you need clustering, disk storage, persistence between restarts, and more configurability of features like time-to-live, maximum cache size, etc.

src/main/docs/guide/usage/annotations.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ class Message implements Serializable {
112112

113113
Note that for in-memory cache implementations it's not required that the objects being cached implement `Serializable` but if you use an implementation that uses Java serialization (for example the Redis plugin, or the Ehcache plugin when you have configured clustered caching) you must implement `Serializable`.
114114

115-
To test this out, be sure to define a `"message"` cache in `grails-app/conf/application.yml` and save and retrieve `Message` instances using the service. There are `println` statements but you can also turn on SQL logging to watch the database access that's needed to retrieve instances that aren't cached yet, and you shouldn't see database access for cached values.
115+
To test this out, be sure to define a `"message"` cache in `app/conf/application.yml` and save and retrieve `Message` instances using the service. There are `println` statements but you can also turn on SQL logging to watch the database access that's needed to retrieve instances that aren't cached yet, and you shouldn't see database access for cached values.
116116

0 commit comments

Comments
 (0)