Cache MultiGet
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
This module significantly reduces amount of cache requests and slightly improves overall site performance.
The idea behind the module is quite simple:
1. On the first page request it saves all cache keys that were fetched within the page load.
2. When the same page requests once again - module already knows what cache keys are going to be used. So it preloads cache data for those keys and keeps it in the memory. After this trick all futher 'cache get' queries will return already loaded cache object from the memory, instead of making new request to the caching backend. Such approach helps to recude requests to cache backend(s) and increase performance of your site.
Will I get any performance benefit?
Yes, but not very significant. As always, it strongly depends on your site. I would say it saves 30-300ms of page load time. But it just gives you a nice performance benefit from nowhere (see How it works section), so you can just install this module and forget about it.
How does it work?
Module provides a layer between cache backend and Drupal. It adds simple proxy logic behind cache backend that saves list of requested cache ids per page url, but completely keeps all behavior of a cache backend. So in a really worst case (when you have billions of pages and noone visit them more than once) you will just not get performance benefit, but no performance decreases or other negative impacts.
How difficult to install and configure this module?
Not difficult at all. You just need to install it as any other Drupal module and then add the following line to your settings.php (or settings.local.php):
$settings['cache']['default'] = 'cache.backend.cachemg.database';
How can I help with this module?
Currently this module needs tests on a real Drupal 8 projects. In theory and on clean Drupal installation is works well. I strongly need your feedbacks to make this module better.
Supported backends
- Database (DrupalCoreCacheDatabaseBackend.php) - Done
- APC (DrupalCoreCacheApcuBackend.php) - In plans
- Memcached - In plans
- Other cache backends - patches are welcome :)
Credits
- Module was designed and developed by Maslovskiy Evgeniy.
- Module development was not sponsored by anyone. It was created for the love of Drupal.
@TODO: Provide benchmarks?
