add cache optimization