Instead of saving VBO actions in a variable, use cache_set and cache_get.

Comments

infojunkie’s picture

Status: Active » Fixed
infojunkie’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
Status: Fixed » Patch (to be ported)

@bojanz, do you prefer this approach?

bojanz’s picture

Version: 7.x-3.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Closed (fixed)

It's a better approach than variable_set / variable_get.
I've talked with catch about this, and he agreed that by speed the order is:
hardcoded list > variable_get -> cache_set / cache_get.

Variable_get is slightly faster (we are talking nano-seconds here), but the fact that it can't be cleared without an update function when VBO is updated is problematic.

So, definitely +1 for cache_set / cache_get in D6.
In D7, I'll keep the hardcoded list. It's already there and working, no reason to touch it further.