Caching panels

public
group: Panels
frank75 - Thu, 2007-08-23 19:29

Hi,
in my site i have used block cache with panels for caching tabs panel.
First i have created mini panels with tabs (last items,more view,more voted) for any contents (news,events...) .
After i have added this mini panels in panel page in home using the block cache version for caching it.

My ideas is of add cache capacibility for any type of contents in panels (view,block,nodes and custom contents) with the same options in block cache:

-cache per user
-cache per page
-cache time limit
-cache where a node is creatred,updated,deleted
-cache when login/logut

what you think?
For adding this option to panels need to write a patch to panels module or is possible with a module that extend the form of contents?

Sorry for my english

You can see my example home page in my site: http://yoga.netsons.org

I could put a hook in

merlinofchaos's picture
merlinofchaos - Thu, 2007-08-23 23:43

I could put a hook in panels_render_display or panels_page_view, where a module could insert caching features?


Hi merlin,

frank75 - Fri, 2007-08-24 08:35

Hi merlin,
i think that must be possible also having an hooks in form edit and form add of the contents for adding the cache hooking modules.
in this 2 functions

'add callback' => 'panels_admin_edit_custom',
'edit callback' => 'panels_admin_edit_custom',

i should need of a hook for adding caching
The caching should be granulary

the hooks should be added here

function panels_ct_get_content($type, $conf, $args, $context, $incoming_content) {
if ($function = panels_ct_function($type, 'render callback')) {
return $function($conf, $args, $context, $incoming_content);
}
}

function panels_ct_get_title($type, $conf) {
if ($function = panels_ct_function($type, 'title callback')) {
return $function($conf);
}
}

function panels_ct_get_add_form($type, $id, $parents) {
if ($function = panels_ct_function($type, 'add callback')) {
return $function($id, $parents);
}
}

function panels_ct_validate_add_form($type, $form, $form_values) {
if ($function = panels_ct_function($type, 'add validate callback')) {
return $function($form, $form_values);
}
}

function panels_ct_submit_add_form($type, $form_values) {
if ($function = panels_ct_function($type, 'add submit callback')) {
return $function($form_values);
}
}

function panels_ct_get_edit_form($type, $conf, $parents) {
if ($function = panels_ct_function($type, 'edit callback')) {
return $function($conf, $parents);
}
}

function panels_ct_validate_edit_form($type, $form, $form_values) {
if ($function = panels_ct_function($type, 'edit validate callback')) {
return $function($form, $form_values);
}
}

function panels_ct_submit_edit_form($type, $form_values) {
if ($function = panels_ct_function($type, 'edit submit callback')) {
return $function($form_values);
}
}