I've been succesfully using Authcache with Drupal Commerce with great results, except for one annoying situation: drupal_set_message().
Being a Commerce website, there's a lot of messages ("item added to cart", "item removed from cart", etc) that need to be displayed after the user performs an action. Drupal core uses drupal_page_is_cacheable(FALSE) to bypass caching when a message is set, but Authcache doesn't respect this as far as I know...
My ugly solution was to use the Cache Expiration module and patch core to programatically invalidate the cache for the redirect/q page when a message is set... it's fugly but works... just wondering whether this kind of scenario has been contemplated and whether I'm just doing things wrong....
Thanks!
Comments
Comment #1
znerol CreditAttribution: znerol commentedActually the mechanism for message handling in authcache is supposed to work in the following way.
If this default implementation is not enough, you may call
authcache_cancel
any time beforehook_exit
to prevent the current page from being saved to the cache and you also may implementhook_authcache_preclude
if you need to ensure that the next page request coming from the same client will not be served from the cache.It would be worthwhile to try investigating why the default implementation does not suffice in your case. I'd approach this problem by first checking whether the theme is doing funny stuff in the
page.tpl.php
. Another thing to check is whether messages are being set after the page is built (e.g. from within templates or theme functions).Comment #2
znerol CreditAttribution: znerol commentedComment #3
alexweber CreditAttribution: alexweber commentedHi, my exact situation revolves around Drupal Commerce and standard "added/removed" from cart messages... i'm using zurb foundation which displays messages in a modal, so that could be related, i'll investigate further
Comment #4
znerol CreditAttribution: znerol commentedOk, do you use the pattern from #1799678: put status messages in reveal-modal?
Comment #5
znerol CreditAttribution: znerol commented