frappe-core-cache

Implement Redis caching patterns with TTL and frappe.lock for Frappe deployments.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package --skill frappe-core-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-core-cache
Source: https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package/tree/main/skills/source/core/frappe-core-cache
Command: npx skills add https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package --skill frappe-core-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers prevent stale caches, race conditions, and unbounded memory growth by providing structured patterns for Redis-based caching, invalidation, and distributed locking in Frappe.

Core Features & Use Cases

  • Standardized API surface for cache operations (set_value, get_value, hset/hget) with automatic key namespacing and optional TTL.
  • Safe cache invalidation strategies and robust locking with frappe.lock to prevent concurrent execution.
  • Guidance across usage scenarios (per-user caching, per-request caching, document caching, and cross-site keys) with practical examples and references.

Quick Start

Start by enabling TTL on external data cache and applying a sample invalidation on a common DocType to validate cache coherence.

Frequently Asked Questions about frappe-core-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent stale cache and race conditions in Frappe?

Apply structured Redis caching patterns with automatic key namespacing, TTL management, and distributed locking via frappe.lock to prevent stale cache and race conditions in Frappe deployments.

What is the best way to manage cache TTL for Frappe REST and background tasks?

Manage cache TTL for Frappe tasks by using standardized API operations like set_value and get_value with optional TTL configurations and automatic key namespacing to ensure deterministic caching across REST and background jobs.

How does distributed locking work with frappe.lock for cache operations?

Distributed locking with frappe.lock works by acquiring safe locks that prevent concurrent execution of cache operations, ensuring data coherence when multiple background or REST tasks attempt simultaneous access.

Can I use hset and hget for per-user document caching in Frappe?

Yes, you can use hset and hget for per-user document caching in Frappe. The Skill provides a standardized API surface supporting these hash operations alongside per-request and cross-site key caching scenarios.

Why does unbounded memory growth happen in Frappe Redis caches?

Unbounded memory growth happens when Frappe Redis caches lack TTL enforcement and invalidation strategies. Mitigate this by applying TTL to external data caches and implementing safe invalidation on common DocTypes.