Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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...
Comment | File | Size | Author |
---|---|---|---|
#5 | d7_panels_cache_post.patch | 2.25 KB | fago |
#1 | 1811054-panels-allow-cache-on-post.patch | 2.24 KB | tayzlor |
Comments
Comment #1
tayzlor CreditAttribution: tayzlor commentedComment #2
tayzlor CreditAttribution: tayzlor commentedThe patch in #1 also applies cleanly to 6.x-3.x branch
Comment #3
tayzlor CreditAttribution: tayzlor commentedComment #4
fagoComment exceeds 80chars.
Also patch does not set cache when $_POST is active.
Comment #5
fagoUpdated the patch to set the cache during post requests also + fixed the 80chars issue.
Comment #6
das-peter CreditAttribution: das-peter commentedOh, 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.