3261885 - Prevent Recursion memory leak
This checks if an entity is already included in the cache tags before including its cache tags and trying to recursively call the function on it. This prevents needlessly repeating calls, and recursive memory leak.