Download the PHP package hryvinskyi/magento2-page-layout-manager without Composer
On this page you can find all versions of the php package hryvinskyi/magento2-page-layout-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hryvinskyi/magento2-page-layout-manager
More information about hryvinskyi/magento2-page-layout-manager
Files in hryvinskyi/magento2-page-layout-manager
Package magento2-page-layout-manager
Short Description Adobe Commerce / Magento 2 Performance optimisation module for avoid entity specific page cache bloat
License MIT
Informations about the package magento2-page-layout-manager
Adobe Commerce / Magento 2 Performance optimisation module for avoid entity specific page cache bloat
This module provides configurable control over entity-specific page layout caching to prevent cache bloat in big stores.
Problem
In Adobe Commerce / Magento 2, when addPageLayoutHandles() is called with entitySpecific = true, it creates
individual cache entries for each entity id or sku (catalog_category_view_id_123.xml or catalog_product_view_id_123.xml or catalog_product_view_sku_test.xml).
In large store setups, this can lead to massive cache growth.
Solution
This module provides two possible configuration:
- Allow Entity-Specific Layout Handles (default: false) - when disabled, blocks all entity-specific layouts like
*_id_*.xml - Use Only Specific Validators (default: true) - When enabled, the entity-specific layout will be added only for validated requests
Composer Installation
Manual Installation
- Create directory
app/code/Hryvinskyi/PageLayoutManager - Download and extract module contents to this directory
- Enable the module:
Features
CMS Page Layout Management
The module automatically disables entity-specific page layouts for CMS pages to prevent cache bloat:
- Admin Panel: The page layout field is disabled (grayed out) in the CMS page edit form with an informative message
- Frontend: Entity-specific page layouts are not applied to CMS pages - only global/theme-level layouts are used
- Cache Optimization: Prevents creation of separate cache entries for each CMS page layout variation
This ensures consistent layout handling across all CMS pages while significantly reducing cache storage requirements.
Usage
Creating Custom Validators
1. Implement the Validator Interface
2. Create Parameter Modifier (Optional)
3. Register in DI Configuration
Available Context Data
The $context array contains:
entity_specific: boolean indicating if this is an entity-specific request- Additional data can be passed by the calling code
Available Parameters
The $parameters array contains the same data passed to addPageLayoutHandles():
- Layout handle parameters like
['type' => 'some_type', 'id' => 123]
Contributing
Contributions are welcome! Please ensure:
- All tests pass
- New features include tests
- Code follows SOLID principles
- Documentation is updated
License
Copyright © 2025 Volodymyr Hryvinskyi. All rights reserved.
All versions of magento2-page-layout-manager with dependencies
magento/framework Version *
magento/module-config Version *
magento/module-cms Version *