Problem with Material drivers for nodes properties
This is how I solved it in my addon. I made a property on materials specifying if I want to update that one live.

from bpy.app.handlers import persistent

@persistent
def live_update_materials(dummy):
    for mat in bpy.data.materials:
        if mat.wow_m2_material.LiveUpdate:
            mat.invert_z = mat.invert_z

bpy.app.handlers.frame_change_pre.append(live_update_materials)


This will reduce the animation playback FPS in the viewport, since the shader will be recompiled on every frame change. But it lets you preview the changes live and is not decreasing the FPS hard to on good hardware.