Skip to content

Enhancement request: Add Helm Job to Clear Frappe Cache After Image Upgrade #274

@krupanshi-itpl

Description

@krupanshi-itpl

Description

When upgrading the Frappe/ERPNext Docker image via the Helm chart, the application sometimes continues to serve stale frontend assets (JS/CSS) from cache. This leads to UI breakages, mismatched assets, or unexpected behavior even though the new image is running successfully.

This issue is typically resolved manually by clearing caches using bench commands and Redis flush, but there is currently no built-in mechanism in the Helm chart to automate this step after upgrades.

Problem

When the image is upgraded:

  • Browser loads old assets
  • Redis still contains cached data
  • Website cache is not cleared

This leads to mismatches between backend code and frontend assets.
Need to exec into a pod and run:

bench clear-website-cache
bench clear-cache
redis-cli FLUSHDB

Proposed Solution

Add an optional Kubernetes Job (or Helm hook) to the Helm chart that runs automatically after upgrade to clear caches.

Possible approaches:
A post-upgrade Helm hook Job
A manually triggerable Job enabled via values.yaml

Job responsibilities:
Run bench clear-website-cache
Run bench clear-cache
Flush Redis (FLUSHDB or FLUSHALL, configurable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions