Skip to content

Commit 7b6e7c1

Browse files
committed
Documentation updated
1 parent b59b944 commit 7b6e7c1

File tree

3 files changed

+29
-33
lines changed

3 files changed

+29
-33
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,14 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
286286

287287
## Changelog
288288

289+
### Version 0.2.0
290+
- Added TTL support for Redis backend
291+
- Added support for Spring Template Expression syntax (#{...})
292+
293+
289294
### Version 0.1.0
290295
- Initial release
291296
- Support for @CacheTags and @EvictTags annotations
292297
- In-Memory and Redis storage backends
293298
- Full Spring Boot auto-configuration
294299
- Complete JavaDoc documentation
295-
296-
### Version 0.2.0
297-
- Added TTL support for Redis backend
298-
- Added support for Spring Template Expression syntax (#{...})

spring-cache-tags-redis/src/main/java/io/github/intellinside/cache/tags/store/RedisCacheTagStore.java

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,28 @@
1414
* Redis-based implementation of {@link CacheTagsStore}.
1515
*
1616
* <p>
17-
* This implementation stores tag-to-key mappings in Redis using Redis Sets.
18-
* It is suitable for distributed systems, clustered deployments, or scenarios
19-
* where
20-
* tag associations need to be shared across multiple application instances.
17+
* This implementation stores tag-to-key mappings in Redis using Redis Sets
18+
* (one Redis Set per tag). It is intended for distributed or clustered
19+
* deployments where tag associations must be shared between application
20+
* instances.
21+
* </p>
2122
*
2223
* <p>
23-
* <b>Features:</b>
24+
* <b>Behavior and guarantees</b>:
2425
* <ul>
25-
* <li>Distributed tag mappings across multiple instances</li>
26-
* <li>Automatic data persistence</li>
27-
* <li>Thread-safe operations through Redis</li>
28-
* <li>Suitable for high-concurrency environments</li>
26+
* <li>Associations are stored in Redis Sets (atomic, concurrent-safe on the
27+
* Redis side).</li>
28+
* <li>Entries are stored as strings in the format {@code {cacheName}:{key}},
29+
* where {@code key} is obtained via {@code toString()} on the provided key
30+
* object.</li>
31+
* <li>TTL (expiration) is applied per-tag when the configured
32+
* {@code RedisCacheConfiguration#getTtlFunction()} returns a positive
33+
* {@code Duration} for the tag. TTL is set using {@code RedisTemplate.expire}.
34+
* </li>
35+
* <li>Methods are null-tolerant: missing Redis Set members produce no entries
36+
* and the lookup returns an empty map when no associations are found.</li>
2937
* </ul>
30-
*
31-
* <p>
32-
* <b>Redis Data Structure:</b>
33-
* <ul>
34-
* <li>Keys: "tag:{tagName}" (Redis Set)</li>
35-
* <li>Values: "{cacheName}:{key}" (serialized cache references)</li>
36-
* </ul>
37-
*
38-
* <p>
39-
* <b>Example:</b>
40-
*
41-
* <pre>
42-
* SET tag:user:123 user-cache:123:details
43-
* SET tag:user:123 user-cache:123:permissions
44-
* SET tag:type:admin admin-cache:456:settings
45-
* </pre>
38+
* </p>
4639
*
4740
* @author intellinside
4841
* @see CacheTagsStore

spring-cache-tags/src/main/java/io/github/intellinside/cache/tags/annotation/SpelExpressionEvaluator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
* <b>Example expressions:</b>
3232
*
3333
* <pre>
34-
* \"'user:' + #userId\" // Concatenates literal with argument
35-
* \"'result:' + #result.id\" // Uses property of returned object
36-
* \"'cache:' + #args[0]\" // Uses first argument
37-
* \"#result.type.toString()\" // Calls methods on result
34+
* "'user:' + #userId" // Concatenates a literal with a named parameter
35+
* "'result:' + #result.id" // Uses a property of the returned object
36+
* "'cache:' + #args[0]" // Uses the first argument from the #args array
37+
* "#result?.type?.toString()" // Safe navigation to avoid NPE when result is null
38+
* "#method.name" // Access method metadata (name, declaringType, etc.)
39+
* "User: #{#userId}" // Template-style expression (uses TemplateParserContext)
3840
* </pre>
3941
*
4042
* <p>

0 commit comments

Comments
 (0)