Advanced Internal Page Cache
This module improves Drupal's internal page caching by allowing you to create contextual cache IDs. It provides a framework for custom modules to define additional cache ID parts based on specific needs, like user cookies or IP addresses.
General
The Advanced Internal Page Cache module allows one to leverage Drupal core's page_cache module to build a contextual cache id.
Technical implementation
The Advanced Internal Page Cache module makes use of the Service Collector pattern and allows a service definition to be tagged with the advanced_page_cache_cid tag.
The module contains two dummy example modules (cookie_page_cache and ip_page_cache).
How to use
* Create a custom module
* Create a .service.yml definition file
* Use class directive to define a class
* Use tags directive to tag with advanced_page_cache_cid
* Use arguments directive to pass the contextual cache id value
* Create a class that implements AdvancedPageCacheInterface
* Implement the method getAdditionalCacheIdPart that returns the cache id part
Resources
- See Service-tags