Combine both versions of cache cleaning lua script in one.