On every page load the _homebox_can_view_block function gets called.

Access permissions for blocks don't change frequently.
Roles of the users can.

We were trying to improve performance on our site and so we cached this setting.

Comments

gitesh.koli’s picture

Patch for this fix.

gitesh.koli’s picture

Updated patch. removed the error with the usage of asort

brianV’s picture

Status: Patch (to be ported) » Needs review

moving to 'needs review'

attiks’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev

Patch is working saving 200-300ms, good work

attiks’s picture

Status: Needs review » Reviewed & tested by the community
Matt-H’s picture

A D7 version of this patch can be found at http://drupal.org/node/1372368.

roderik’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

If you already cache things inside _homebox_can_view_block(), then why would you need to cache the return values of _homebox_can_view_block() too? See #1213154: Cache query results to improve performance