[ADCOM-7] CacheManager should be a singleton Created: 13/Oct/20  Updated: 13/Oct/20  Resolved: 13/Oct/20

Status: Closed
Project: Addon Commons (closed)
Component/s: None
Affects Version/s: 1.0
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1h
Original Estimate: Not Specified

Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

The CacheManager object should be annotated as a Singleton.

Similar to the other cache module which uses a CacheFactoryProvider

OR

The CacheModule could provide a getter method.



 Comments   
Comment by Richard Gange [ 13/Oct/20 ]

After a closer look I found out the problem is there are two caches for s3:

  • s3-buckets
  • s3-objects

In groovy to clear everything and refresh the view:

import info.magnolia.objectfactory.Components
 
cacheManager = Components.getComponent(info.magnolia.addon.commons.cache.CacheManager)
cacheManager.evictCache("s3-buckets")
cacheManager.evictCache("s3-objects")
println "s3 cache cleared"

We actually should consider creating two string for the caches with descriptions:

static final String S3_BUCKETS_CACHE = "s3-buckets";
static final String S3_OBJECTS_CACHE= "s3-objects";
Generated at Sun Feb 11 23:00:44 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.