function boost_boost_is_cacheable in Boost 7
Implements hook_boost_is_cacheable().
TODO support for node types, etc.
Parameters
$parts: info about this request
$request_type: if the request_type is "status", we assume that this is being called from the admin status block. Since the user must be logged in to view this block, we do not return false.
Return value
$parts
File
- ./
boost.module, line 750 - Caches generated output as a static file to be served directly from the webserver.
Code
function boost_boost_is_cacheable($parts, $request_type = 'normal') {
global $user;
if ($user->uid != 0 && $request_type !== 'status') {
$parts['is_cacheable'] = FALSE;
$parts['is_cacheable_reason'] = 'Boost only works for anonymous users.';
}
else {
$parts['is_cacheable'] = TRUE;
}
return $parts;
}