I suspect this is either a support request if I'm missing something obvious, or a bug report. My setup:

Using Views and Flag module, I am display the Most Recently Viewed Nodes for each anonymous user. So in order to have cached pages obviously AJAX Blocks is perfect. Since the View is using a Flag relationship, however, it encounters the following code from the flag module, flag_handler_relationships.inc:

class flag_handler_relationship_content extends flag_handler_relationship {
...
        drupal_page_is_cacheable(FALSE);
...
}

So whenever the View is rendered, page cache is not created for that page.

So I am trying to configure AJAX Blocks to always load AJAX no matter what, to allow the page to cache initially using the settings:

* Load block via AJAX = YES
* Include NOSCRIPT tag with original block content = NO // I'm assuming if this is YES then the view will be rendered but hidden and thus page cache never generated.
* Load the block on cached pages for these roles only = Anonymous User
* Load the block on uncached pages for these roles only = Anonymous User

With the above settings should I be expecting the block to only ever render from an AJAX call?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aze2010’s picture

subscribing

aze2010’s picture

Issue summary: View changes

formatting

deardagny’s picture

carn1x - Were you able to get caching working? I've got an identical use case and wondering if you made any progress.

maximpodorov’s picture

The block is rendered on such page even if it will be loaded later by AJAX. This is needed since block content may require additional CSS and JS files.

helmo’s picture

SpaghettiBolognese’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
8.28 KB

Please try (and review) this patch. It removes the render of ajaxblocks on page calls and renders it only via ajax. It also adds the js/css files in ajax calls.

HansKuiters’s picture

Patch works like a charme for my project. Tested in dev, no caching active.

I need to test in live with varnish. Maybe later this week.

liquidcms’s picture

Status: Needs review » Needs work

perhaps i miss the point of this module.. without this patch the block is never loaded with ajax.. it is just loaded normally.

with this patch it is ALWAYS loaded by ajax; even if other conditions set it to be unloadable.

so i think the module doesn't work and this patch doesn't work.