Is there any reason that facetapi blocks can't have an option to be cached globally? I've got a lot of facets, and caching them on a per-role basis clogs up the block cache. Each block is identical for every user on my site, so I don't need them to be cached per role.

Screenshot: http://i.imgur.com/k27Zs.png

CommentFileSizeAuthor
#3 1814078-facetapi-block-cache-options.patch869 bytescafuego
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

The reason is access control, where Facet API doesn't have any concept of whether the user has access to the resource. If you have node access enabled and global caching, restricted content could be displayed to unprivileged users. However, I would be in favor of allowing for a global cache setting given that it displays a loud warning saying that a potentially insecure setting is active if node access is being leveraged as well.

JordanMagnuson’s picture

I agree that a warning message would be good, but I do think it should be an allowed option.

cafuego’s picture

Status: Active » Needs review
FileSize
869 bytes

Attached patch adds 'Global' and 'Per page' cache options and relabels the existing cache options more appropriately, since they are each a combination of two cache options.

It does not add the suggested warning!

cpliakas’s picture

Issue summary: View changes
Status: Needs review » Needs work

Thanks for the contribution!

Before adding this we really need to add some sort of warning, because adding an option that effectively bypasses access control is a scary thing to me.

I do like the additional clarification of the "Per role per search page" and would commit that without further discussion.

Chris

JordanMagnuson’s picture

Isn't the content access issue handled by Drupal core? I've enabled modules that define content access restrictions, and as a consequence, I can't enable ANY amount of caching for this, or any other block.

Screenshots:

http://imagizer.imageshack.com/img537/2523/b3f251.png

http://imagizer.imageshack.com/img539/3704/2b5434.png

Doesn't that take care of any warning needs?