Caching and Pretty URLs

Permalink
1. I installed c5.5.2.1 and immediately disabled basic and full page caching.
2. I added several pages.
3. I enabled Pretty URLs. (Worked fine, .htaccess was written successfully.)

Then, I tested everything and saw that some pages still contained "index.php" in the URL.
After testing this and that, I found out that it was a caching problem. I cleared the cache and then all URLs were shown correctly (without "index.php").

Can anybody explain this to me?
Why is it necessary to clear the cache although the caching was disabled anyway?