Make cache script level instead of buffer level