Hi,
First off thank you for such an amazing platform to use. I am still getting use to it and enjoying it immensely. I have one question regarding caching during development. I am aware of the following to clear cache:
./artisan cache:clear
However, it seems I have to run this frequently to see changes which is inconvenient. A hack would to write a shell script like this:
cache.sh (chmod +x)
#!/bin/bash
while true; do
php artisan cache:clear
sleep 2: # Re-run every two seconds, or until this is cancelled out
done
Another possible way (I am unsure of) is to use array caching possibly, rather than files.
config/cache.php
'default' => 'array',
This will obviously do nothing:
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
Lastly, another idea I had was to set opcache off and even run the artisan command from the PHP script. I prefer the .env setup, so I tried mocking this up but I'm not sure where I should place it..
Final Attempt
./.env
DISABLE_CACHE=true
./.htaccess (Apache)
php_flag opcache.enable Off
Or FastCGI
./.user
opcache.enable=0
Or
ini_set('opcache.enable', 0);
I couldn't find the best solution nor know how you develop with the cache constantly rebuilding the front-end, any advice would be greatly appreciated. Im sorry if this has been covered in the docs or a forum I was not able to find it.