Caching Naming Convention
This document outlines the naming convention for cache keys used within the project. To ensure consistency and avoid key collisions, all cache keys should follow the format below:
Naming Convention Format
tenant_corporation-id_user-id_section
Key Components
tenant
- Represents the tenant or customer for which the cache is being created.
- Example:
demo,phpc, etc.
corporation-id
- Refers to the corporation or company id associated with the cache data.
- Example:
6
user-id
- A unique identifier for the user accessing or interacting with the cache.
- Example:
32
section
- Represents the specific section or resource of the application for which the cache is being stored.
- Example:
kvs,preferences,form-fooetc.
Example Cache Keys
demo_12_3_kvsphpc_6_32_preferences
Guidelines:
- Always use lowercase letters for all parts of the key.
- Separate each component using an underscore (
_). - Seperate sections with multiple words using a hyphen (
-). - Ensure that each part is descriptive and clearly identifies the cache’s context.
- The section should refer to the specific resource or functionality (e.g., “auth” for authentication-related data, “orders” for order-related data).
This naming convention helps to avoid cache collisions and improves cache organization.
Last updated on