Version: 1.0.0
License: Proprietary
Developer: iTeffa (iteffa@flowaxy.com)
Studio: FLOWAXY
Website: https://flowaxy.com
Cache View plugin for Flowaxy CMS provides a user-friendly interface for viewing and managing system cache. The plugin displays cache statistics, allows viewing cache files, identifies cache sources (plugins, themes, system), checks cache expiry status, and provides tools for clearing cache.
Note: For the best visual experience, refer to the screenshot in the
assets/images/directory.
- π Cache Statistics β View total files count, total cache size, and expired items count
- π Cache File Listing β Browse all cache files with detailed information
- π Cache Source Detection β Automatically identifies cache sources:
- Plugin cache (shows plugin name)
- Theme cache (shows theme name)
- System cache (shows cache type label and category)
- π₯ Activity Heatmap β Visual indicators showing cache usage frequency:
- π΄ High activity β Frequently accessed cache items
- π‘ Medium activity β Moderately used cache items
- π’ Low activity β Rarely accessed cache items
- Shows access count and last access time
- β° Expiry Status β Checks if cache items are expired or active
- Shows expiry time and remaining time for active items
- Highlights expired items
- ποΈ Cache Content Viewer β View cache file content in JSON, PHP Array, or raw text format
- ποΈ Cache Management β Clear entire cache or individual cache items
- π Sortable Table β Sort cache items by key, source, status, size, or modification date
- π± Responsive Design β Mobile-friendly interface with adaptive layouts
- Desktop: Full table view with all details
- Mobile: Card-based layout optimized for small screens
- β Access Control β Permission-based access to cache management
- File system cache scanning
- Cache file content analysis (deserialization)
- Integration with Flowaxy CMS cache settings
- Timezone-aware cache expiry checking
- Modal dialogs for safe cache clearing
- PHP >= 8.4.0
- Flowaxy CMS with plugin support
- Read/write access to cache directory
- Admin access for cache management
- Copy the plugin directory to
plugins/cache-view/. - Activate the plugin via the admin panel (Settings β Plugins).
- The plugin will automatically register its route and menu item.
No database tables are required - the plugin works with existing cache files.
- Log in to the admin panel.
- Navigate to System β Cache View in the menu.
- Or go directly to
/admin/cache-view.
The plugin displays three main statistics cards:
- Total Files β Number of cache files
- Total Size β Total cache size (KB or MB)
- Expired Items β Number of expired cache items
Each cache file shows:
- Key β Cache key (filename without extension)
- Source β Where the cache comes from:
- Plugin name (if from a plugin)
- Theme name (if from a theme)
- System cache type (e.g., "Site Settings", "Admin Menu")
- Cache Type β Category of cache (routes, translations, configuration, user, etc.)
- Activity β Usage frequency indicator:
- π΄ Π§Π°ΡΡΠΎ (High) β Frequently accessed (60+ score)
- π‘ Π‘Π΅ΡΠ΅Π΄Π½ΡΠΎ (Medium) β Moderate usage (20-60 score)
- π’ Π ΡΠ΄ΠΊΠΎ (Low) β Rarely accessed (<20 score)
- Shows access count and last access time
- Status β Cache expiry status:
- π’ Active β Cache is valid (shows remaining time)
- π΄ Expired β Cache has expired (shows time ago)
- βͺ Unknown β Cannot determine expiry status
- Size β File size (KB or MB)
- Updated β Last modification time
- Actions β View content and delete buttons for individual cache items
- Click on column headers to sort cache items:
- Key β Sort alphabetically by cache key
- Source β Sort by cache source
- Activity β Sort by activity level (high β low)
- Status β Sort by expiry status
- Size β Sort by file size
- Updated β Sort by modification date
- Sort direction toggles between ascending and descending
- Visual sort indicators show current sort column and direction
- Click the "Clear All Cache" button in the page header.
- Confirm the action in the modal dialog.
- All cache files will be deleted (system files like
.gitkeepand.htaccessare preserved).
Note: The button is disabled when cache is empty.
- Click the eye icon (ποΈ) next to any cache item.
- The cache content will be displayed in a modal dialog.
- View content in three formats:
- JSON β Formatted JSON representation
- PHP Array β PHP var_export format
- Raw β Raw text content (for non-serialized data)
- Click the trash icon (ποΈ) next to any cache item.
- Confirm the action in the modal dialog.
- The selected cache file will be deleted.
The plugin checks cache expiry by:
- Reading cache file content
- Looking for
expiresfield in serialized data - If
expiresis missing, calculating expiry using:createdtimestamp +cache_default_ttlfrom system settings
- Comparing with current time to determine status
Cache settings are retrieved from:
cache_enabledβ Whether caching is enabledcache_default_ttlβ Default cache lifetime (seconds)
cache-view/
βββ assets/
β βββ images/
β β βββ screenshot.png # Plugin screenshot
β βββ styles/
β βββ cache-view.css # Styles for the cache view page
βββ src/
β βββ admin/
β β βββ pages/
β β βββ CacheViewAdminPage.php # Admin page controller
β βββ Services/
β βββ CacheStatsTracker.php # Cache activity tracking service
βββ templates/
β βββ cache-view.php # Cache view page template
βββ tests/
β βββ CacheViewPluginTest.php # Diagnostic tests
βββ .gitignore # Git ignore rules
βββ init.php # Plugin initialization
βββ plugin.json # Plugin metadata
βββ README.md # Documentation
The plugin uses a service-oriented architecture:
- CacheViewAdminPage β Admin panel page for cache management
- CacheStatsTracker β Service for tracking cache access statistics
- Templates β PHP templates for HTML rendering
- Components β Reusable admin UI components:
stats-cards.phpβ Statistics cardsdata-table.phpβ Sortable data tableempty-state.phpβ Empty state displayinfo-block.phpβ Information blocksmodal.phpβ Modal dialogs
The plugin determines cache source by:
-
Key Pattern Analysis β Checks for known prefixes:
plugin_data_*β Plugin cachetheme_settings_*,theme_config_*,theme_*β Theme cache- Other keys β System cache
-
Content Analysis β For generic hash keys:
- Unserializes cache file content
- Checks data structure:
- Plugin data: Contains
id,slug,name,installed_atfields - Theme data: Contains
slug,name,is_default,supports_customizationfields - System data: Analyzes structure to determine cache type (routes, translations, configuration, etc.)
- Plugin data: Contains
The plugin tracks cache access to display activity heatmap:
- Automatic Tracking β Integrated into the core Cache class
- Activity Score β Calculated based on:
- Recent 24-hour activity (60% weight)
- Recent 7-day activity (30% weight)
- Total access count (10% weight)
- Activity Levels:
- High (60-100 score) β Frequently accessed
- Medium (20-60 score) β Moderate usage
- Low (0-20 score) β Rarely accessed
- Statistics Storage β Saved to
.cache-stats.jsonin cache directory - Auto-cleanup β Old statistics (30+ days) are automatically removed
The plugin checks cache expiry status:
- Reads cache file and unserializes content
- Looks for
expirestimestamp field - If missing, calculates:
created+cache_default_ttl(from settings) - Compares with current time:
- Active β
expires > current_time - Expired β
expires < current_time - Unknown β Cannot determine expiry
- Active β
- β CSRF protection for all write operations
- β Access permission checks before executing operations
- β Path traversal protection when accessing cache files
- β XSS protection via output sanitization
- β
System file protection (
.gitkeep,.htaccessare never deleted)
The plugin uses the following hooks:
admin_register_routesβ Register admin routeadmin_menuβ Add menu item to System sectionsettings_categoriesβ Add plugin to settings page
The plugin utilizes reusable admin components:
- Stats Cards β For displaying statistics (total files, size, expired)
- Data Table β For displaying cache items with sorting
- Empty State β For displaying "Cache is empty" message
- Info Block β For displaying system cache information
- Modal β For confirmation dialogs
The plugin respects cache settings from Site Settings (/admin/site-settings):
- Enable Caching β Whether caching is enabled
- Cache Default TTL β Default cache lifetime (seconds)
- Auto Cleanup β Automatic cleanup of expired cache
These settings affect:
- Expiry status calculation
- Cache source detection
- Statistics display
By default, the plugin:
- Shows all cache files from the cache directory
- Filters out system files (
.gitkeep,.htaccess) - Displays cache statistics
- Allows clearing cache (if user has permissions)
- Sorts cache items by modification date (newest first)
The plugin uses the following components from the Engine:
engine/core/support/base/BasePlugin.phpengine/interface/admin-ui/includes/AdminPage.phpengine/core/support/helpers/UrlHelper.phpengine/core/support/helpers/SecurityHelper.phpengine/core/support/managers/SettingsManager.php(for cache settings)engine/core/support/managers/PluginManager.php(for plugin name resolution)engine/core/support/managers/ThemeManager.php(for theme name resolution)
To extend the plugin:
- Add new cache source types β Modify
detectCacheSource()method inCacheViewAdminPage.php - Add new statistics β Extend
getCacheInfo()method and update template - Customize expiry checking β Modify
checkCacheExpiry()method - Add filtering options β Extend template with filter UI and update
getCacheInfo() - Customize UI β Edit
templates/cache-view.phpandassets/styles/cache-view.css
The plugin reads from the cache directory defined by:
CACHE_DIRconstant (if defined)ROOT_DIR . '/storage/cache'(default)- Fallback to
dirname(__DIR__, 5) . '/storage/cache'
Important: The plugin only reads cache files and never modifies them directly. Cache clearing operations use the Cache API or file system operations with proper access controls.
Cache not appearing:
- Verify cache directory permissions (read access required)
- Check if cache is enabled in Site Settings
- Ensure cache files have
.cacheextension
Cannot clear cache:
- Verify user has
admin.cache.clearpermission - Check cache directory write permissions
- Ensure system files (
.gitkeep,.htaccess) are not missing
Expiry status showing as "Unknown":
- Verify cache files are properly serialized
- Check
cache_default_ttlsetting in Site Settings - Ensure cache files have valid
createdorexpiresfields
If you find a bug or have questions:
- Check log files for errors (
storage/logs/) - Verify cache directory permissions
- Ensure cache files are readable
- Check system cache settings in Site Settings (
/admin/site-settings) - Review the diagnostic tests output
The plugin includes a set of diagnostic tests to verify functionality. Tests are located in the tests/ directory:
- CacheViewPluginTest.php β Set of automatic tests to verify:
- Getting cache info with empty cache
- Getting cache info with files
- Cache source detection (system cache)
- Cache expiry checking (active and expired)
- Getting cache settings from database
- Time formatting (time ago and time left)
- Clear cache button creation (enabled and disabled states)
Tests are automatically loaded through Flowaxy CMS TestService and TestRunner system.
To run the diagnostic tests:
php engine/application/testing/cli/run-tests.php --plugin=cache-viewOr use the Flowaxy CMS test runner:
php flowaxy test --plugin=cache-viewYou can test cache functionality manually by:
- Creating test cache files manually
- Checking if they appear in the cache view
- Verifying expiry status
- Testing cache clearing functionality
Proprietary. All rights reserved.
Initial Release
- β¨ Initial release
- β Cache file listing and statistics
- β Cache source detection (plugin, theme, system)
- β Cache expiry status checking
- β Cache clearing (all or individual items)
- β Sortable table with column sorting
- β Responsive design (desktop and mobile)
- β Modal dialogs for confirmations
- β Integration with Flowaxy CMS Engine
- β Reusable admin UI components
- β Empty state handling
- β Disabled button when cache is empty
- β Cache activity tracking and heatmap
- β Cache content viewer (JSON, PHP Array, Raw)
- β Cache type categorization
- β Diagnostic tests
- β CSRF protection
- β Permission-based access control
FlowAxy
Developer: iTeffa
Email: iteffa@flowaxy.com
Studio: FLOWAXY
Website: https://flowaxy.com
Proprietary. All rights reserved.
Developed with β€οΈ for Flowaxy CMS
