-
Notifications
You must be signed in to change notification settings - Fork 105
docs: Add comprehensive cache implementation guide for Joomla 5/6 components #582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Complete CacheService implementation with global config support - Cache key generation strategies with CacheHelper - ListModel and ItemModel integration examples - Automatic cache invalidation patterns for CRUD operations - Best practices for respecting Joomla configuration - Real-world performance metrics and results This guide addresses common developer challenges when implementing caching in custom Joomla 5/6 components, providing production-ready code examples and clear explanations.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||
- Add try-catch blocks to CacheService methods (get, remove, clean) - Implement graceful degradation with fallback execution - Add Joomla Logger integration for error tracking - Add detailed PHPDoc comments to all methods - Addresses qodo-code-review 'Secure Error Handling' compliance All cache operations now handle exceptions gracefully without breaking the application, providing proper logging and user feedback.
- Fix cache controller method calls: remove incorrect ->cache->cache chain - Fix cache invalidation: use correct 'com_mycomponent' group instead of non-existent subgroups - Simplify cache clearing in save() and delete() methods - Add performance note about aggressive cache invalidation Addresses qodo-code-review suggestions: - 'Directly call cache controller methods' (importance 8/10) - 'Refine cache invalidation strategy' (importance 9/10)
|
I expect that this is AI generated, I would also expect that this means you don't own the copyright and provide it under the Joomla EDL. I'm right? |
|
You are correct. I have no copyright claims over these code snippets and/or texts. All the material provided is under the Joomla EDL, and it is free to be reproduced, modified, and integrated into the core documentation. Regarding the process: I used AI to help summarize the commit messages and refine the text for better clarity, but I have personally reviewed and corrected the technical implementation to ensure it follows Joomla's best practices. My goal is simply to contribute to the community's performance standards. |
|
Thank you for your interest in contributing to the Joomla developer documentation, but to be honest the content which AI generated isn't great. It needs to provide good explanations to developers wanting to learn how to use Joomla cache. Have a look at the current page at https://docs.joomla.org/Cache_Basic_API_Guide and you'll maybe understand what I'm getting at. The document should go into the General Concepts area, as that is where to find documentation which relates to different types of Joomla extension. The sections at the end generated by AI don't fit into the Joomla documentation either - have a look at the current documentation. This needs a fair bit of rework I'm afraid. |
|
You are right again. Thanks for advise. In other way, consider to update informations to the Joomla 6 Manual. |
Summary
This PR adds a complete, production-ready guide for implementing caching in custom Joomla components using the native Cache API.
What's Included
1. Complete CacheService Implementation
$caching,$cachetime,$cache_handler)2. CacheHelper Utility Class
3. Model Integration Examples
4. Cache Invalidation Patterns
5. Best Practices
6. Real-World Results
Why This Documentation Is Needed
Currently, developers struggle to find:
This guide fills that gap with production-ready code that follows Joomla best practices.
Location
docs/building-extensions/performance/implementing-cache.mdTesting
The code examples are based on a real production implementation.
Related