Content Access Booster

Component ID

2915860

Component name

Content Access Booster

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

41

Component created

Component changed

Component body

Abstract

Boost large websites using content_access (eventually combined with other access modules like node access node reference or node access user reference

Context & Problem

On large websites node / entity access / permission checks may become quite relevant for performance. With a large growing number of nodes and users modules like

don't scale well. In some cases we had complex websites with thousand of nodes where nodeaccess_nodereference lead to very large grant SQL statements and pages loading >10 seconds. This delay grew with every further node.

Solution

In many cases content_access is used as base module for setting generic node type + role based permissions.
content_access is quite old and doesn't use hook_node_access but grants instead.
That's OK, but looking at node_access you can see potential for performance improvements:

hook_node_access allows simple and generic access checks before building complex grant structures needed for complex cases.

So what this module does is simply to implement hook_node_access and perform a more lightweight check against the content_access node type settings if possible.
Because Drupal permission logic allows (NODE_ACCESS_ALLOW) but never re-restricts access we only care for cases where we know that we can definitely allow access. If we don't know that clearly we let the more complex access rules decide using grants NODE_ACCESS_IGNORE.

In our example we could speed up load times from >10 seconds to 0.5 seconds without any negative impacts.

Installation and usage

Simply download and enable this module. There is no extra configuration because it simply uses content_access settings.

Alternatives

  • node_view_permissions also uses hook_node_access for early access check skips. If you don't already use content_access, that may be a single module alternative for you.

Development proudly sponsored by German Drupal Friends & Companies:

webks: websolutions kept simple (http://www.webks.de)
and
DROWL: Drupalbasierte Lösungen aus Ostwestfalen-Lippe (http://www.drowl.de)