Skip to content

Add filterable caching system with auto-invalidation.#32

Merged
kettasoft merged 11 commits intomasterfrom
feat/caching
Nov 12, 2025
Merged

Add filterable caching system with auto-invalidation.#32
kettasoft merged 11 commits intomasterfrom
feat/caching

Conversation

@kettasoft
Copy link
Owner

Summary
Adds caching support for Filterable queries, providing:

  • FilterableCacheManager: singleton cache manager with tagging, scoping, and profiles.
  • HasFilterableCache trait: fluent API for caching filterable queries.
  • CacheKeyGenerator & CacheInvalidationObserver: deterministic key generation and automatic invalidation on model events.
  • Invoker integration: supports terminal-method caching.
  • Config & docs: caching configuration in filterable.php and user documentation.
  • Unit tests: covers caching behavior.

Why
Enable high-performance caching for Filterable queries with safe invalidation and profiling, ready for production use.

How to test / review

  • Ensure Laravel 9+ and PHP 8.1+ environment.
  • Merge filterable.php config changes.
  • Run unit tests: composer install && phpunit.
  • Smoke test: set FILTERABLE_CACHE_ENABLED=true and CACHE_DRIVER=redis, call ->cache(3600), verify cache hits/misses and invalidation.
  • Optional: performance profiling as described in docs.

Notes

  • Tagged invalidation requires Redis or Memcached.

- Introduced "Cache Profiles" documentation detailing reusable cache configurations, usage examples, and best practices.
- Added "Cache Scoping" documentation explaining user, tenant, and custom scoping with practical use cases.
- Created "Caching Strategies" documentation covering various caching techniques including time-based, conditional, tagged, and profile-based caching.
- Cleaned up whitespace and formatting across multiple files.
- Enhanced table formatting for better readability in auto-invalidation and caching strategies sections.
- Updated examples to ensure consistent use of cache tags and scopes.
- Improved descriptions and organization of caching profiles and strategies.
- Added best practices and use cases for caching to provide clearer guidance.
- Ensured all code snippets are properly formatted and aligned with documentation standards.
@kettasoft kettasoft merged commit 962cf11 into master Nov 12, 2025
1 check passed
@kettasoft kettasoft deleted the feat/caching branch November 18, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant