dotCMS / dotCMS/core

[FEATURE] Cache Management APIs

Open
#35,190 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team : Modernization
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

Cache management (flushing caches, viewing region names, viewing cache statistics) is currently only accessible via JSP. The cache region dropdown is populated by a JSP scriptlet calling CacheLocator.getCacheIndexes(). Cache statistics (JVM memory + per-provider per-region hit/miss rates) are rendered by cachestats_guava.jsp. Flushing a specific cache region uses a Struts form POST to ViewCMSMaintenanceAction._flush(). Need REST endpoints to answer "What's in cache and how do I flush it?"

Goal

Provide REST endpoints for listing cache region names, viewing cache statistics, and flushing cache regions with proper side effects (permission reset, PushPublishing filter reload).

APIs

  • GET /v1/caches — List cache region names for selection
  • GET /v1/caches/stats — Cache statistics with JVM memory and per-region hit/miss rates
  • DELETE /v1/caches/{regionName} — Flush specific region or all caches

Personas

  • Developer Teams — Need REST APIs for Angular Cache tab
  • System Administrators — Need to monitor cache health and flush caches when troubleshooting

Legacy Reference

  • JSP: view_cms_maintenance.jsp lines 1327–1427 (Cache tab)
  • JSP: cachestats_guava.jsp (cache stats rendering)
  • Struts Action: ViewCMSMaintenanceAction._flush() lines 273–280
  • Target Class: CacheResource.java (/api/v1/caches)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CacheResource.java at /api/v1/caches, then compare the cache behavior in view_cms_maintenance.jsp, cachestats_guava.jsp, and ViewCMSMaintenanceAction._flush(). Implement the three listed endpoints for region names, JVM and per-region statistics, and flushing, including the stated permission reset and PushPublishing filter reload side effects. Done means the REST APIs support the Angular Cache tab and administrator troubleshooting needs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.