I have a Symfony2 website that I am testing in production. I went ahead and cleared his cache because I did and probably will make more changes, however there is a little problem:
While the cache is clearing and saying, after which I want to warm it, the one who accesses the website restores the cache. This creates a small problem as the cache is created, but not completely, while half of it is deleted, since the deletion is still ongoing.
What happens after that, the cache is built, but only part of it. Symfony believes that the cache is fully built and works without trying to create it, but it works with a semi-developed cache. The removal process is a little long (~ 15 seconds), so no one should try to create a cache by accessing the website during this timeframe.
Either this, or the cache is completely built, it overwrites the old cache, and the system processes these new files as old ones, removes some of them and some others. Not quite sure, I'm not sure how to check this.
For example, one of the errors I received is
The directory "D:\xampp\htdocs\med-app\app\app\cache\dev/jms_diextra/metadata" does not exist.
If I did not use this package, I would get another cache problem from Doctrine. This appears on every website until I delete the cache again WITHOUT any access to the website. it completely blocks access to the website and makes it non-functional.
Also, how about a warm up? It takes time. What if someone accesses the website while the cache is warming up? Doesn't that also create a conflict?
How to deal with this problem? Do I need to close the apache service, flush and heat the cache, and then restart apache? How is this handled with the website in production?
EDIT Something interesting that I discovered. Error deleting cache/prod folder. If I delete the contents of the folder without deleting the folder itself, it seems like an error does not occur. I wonder why.