Active
Project:
Boost
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2012 at 15:31 UTC
Updated:
25 Apr 2012 at 14:38 UTC
Hi,
I have a module:
$items['getlocations/info'] = array(
'page callback' => 'getlocations_info',
'page arguments' => array(2, 3),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
function getlocations_info($lid, $lidkey) {
return '<p>my html</p>';
}
If I enter this url '/getlocations/info/2/nid/cache.html' to my browser I see some html output. Is it possible to cache this output?
I enabled caching for 'text/html' and copied genarated rules to .htaccess. All nodes are cached. Only the output from the module is not. I checked folder '/cache' and it does not contain cached output from the module.
Thanks, Martin.
Comments
Comment #1
MPeli commentedI tryied the same approach with json
with url '/getlocations/info/2/nid/cache.json' and no result (the output is not cached into a file). Is this a good approach? How I can cache output from a custom module?
Thank you, Martin.
Comment #2
bgm commentedCheck in the boost.module code for:
* function boost_transform_url()
* function boost_is_cacheable()
* see if you need to implement: hook_boost_is_cacheable (around line 534)
I have to admit that (while I co-maintain the module), I haven't tested this much. If you can experiment with this and see how it works, it will be nice to have a handbook page on the topic.