Prevent an infinite loop from occurring when caching is enabled.