By default panels assumes that you would never want to cache any displays / panes on a $_POST request.
This is quite an assumption, in some cases you might want the contents of a pane, or an entire display to be cached on a $_POST request (for example if it will display the exact same content regardless of GET or POST).

On some pages on our site (where we have a form and surrounding mini panels) - this is giving us a boost of around 2 seconds.

Patch to follow...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tayzlor’s picture

Title: Allow panel displays and pane to be cached on a POST request » Allow panel displays and panes to be cached on a POST request
Version: 6.x-3.x-dev » 7.x-3.x-dev
FileSize
2.24 KB
tayzlor’s picture

Status: Needs review » Active

The patch in #1 also applies cleanly to 6.x-3.x branch

tayzlor’s picture

Status: Active » Needs review
fago’s picture

Status: Active » Needs review
+++ b/includes/plugins.inc
@@ -41,8 +41,16 @@ function panels_get_regions($layout, $display) {
+    // Here we check if a caching plugin has implemented the ability to cache on $_POST requests.
+    // If it has we use what is selected for this display / pane, otherwise we revert back to the default
+    // of never caching on a POST request.

Comment exceeds 80chars.

Also patch does not set cache when $_POST is active.

fago’s picture

FileSize
2.25 KB

Updated the patch to set the cache during post requests also + fixed the 80chars issue.

das-peter’s picture

Issue summary: View changes

Oh, me likes the idea. Have this to give a test :)
I'd say the patch looks pretty good and even contains a "Don't try at home" line which points out that this could have unwanted side-effects if you don't know what you're doing.
Still have to try it *in the wild* though.