In my Laravel app, I sometimes want to pull the latest version from GitHub without clearing the cache first.
So I just do:
git pull origin staging
But every time I do this and then open the page in the browser, I get this error:
ErrorException (E_WARNING)
file_put_contents(/path/to/laravel/storage/framework/cache/data/30/6c/306cbe845aa9840ab0c14a1cd4b5d83fd6728839): failed to open stream: Permission denied
However, if I just do php artisan cache:clear this issue doesn't happen.
This isn't ideal because I'd sometimes like to keep the cache when I pull changes from Git. We use caching extensively (on every request) and it's a performance issue if we have to clear it on every update.
For example, the last time this happened, my only change was to a View file. No need to mess with the existing cache.
How can I pull changes from Git without clearing the cache and without encountering errors?