This patch provides an API to support multiple cache directories. If no module implements one of the hooks, boost will fall back to the current mechanism, i.e. the normal cache directory.
The patch introduces the following hooks:
hook_boost_cache_variant(): Return an array describing cache variants where keys are variant names and values are arrays containing the following elements (currently only dir): dir: The name of the cache directory for this variant.
hook_boost_cache_variant_alter(&$variants): Let third party modules modify the variants array.
boost_active_cache_variant(&$name): Let third party modules choose the cache variant which should be active for the current request.
Beside the new hooks, the patch also modifies the following functions in order to make them work with multiple cache directories:
boost_requirements
boost_cron
boost_flush_caches
boost_transform_url
boost_htaccess_cache_dir_put
This patch also is a result of the ongoing integration work announced in #1932444: Boost as Authcache Backend. However it also should help with #629520: Cache by theme for mobile sites..
Comments very welcome.
Comments
Comment #1
znerol commentedComment #2
jason.fisher commentedWith latest dev:
Comment #3
marcelovaniI tried the patch but it doesn't apply
Comment #4
socialnicheguru commentedafter applying the patch will I be able to hook boost into different backends like memcache for example?
Can you explain what 'multiple cache directories' mean and why it is important to boost?
Comment #5
marcelovaniI need to use this patch, so I re-rolled to make it apply on current dev branch.
I did not test it thoroughly and I don't know if the patch works, but I will do some tests as soon as I can and add comments here.
Just one change on previous patch:
I believe the order of the parameters was wrong here and I changed.
Needs reviewing