I must agree with most notes here. I found falw in my code. In fact it didn't cahe at all if query didn't hit exactly same aura. I fix it by:
Lua Code:
if cache and cache[key] and cache[key]['stamp'] == ("%.1f"):format(GetTime()) then -- cached values updated 10 times per second
if cache[key][index] then retTable = cache[key][index] else retTable = {} end
else -- fetch new cached values
now it is really effective and overhead is small if multiple aura checks by name are done in one cycle (in split .1s). Keep in mind these wrappers are just for time period when code need to be 7.x compatible and you want to do just small or none changes for testing in 8.x. These functions aren't permanent for 8.x. I'm pretty sure that someone come with new UnitAUra, UnitBuff and UnitDebuff for quering aura by Name. BTW someone told about UnitAura doesn't support query by Name in 7.x I must disagree it does support. Form is UnitAura(unit,name[,[nameSubtext][,filter]]).