General question about Cron Jobs and Laravel caching / setup

One important thing to be aware of: our cron jobs tool is a web cron tool. This means it doesn’t run a system command, but instead calls a URL at the configured schedule. So you won’t be able to call php artisan schedule:run or other Artisan commands or other PHP code directly. But you could setup a web route that calls Artisan::call('schedule:run') instead.

There is no way to trigger code to be executed when data in a database changes. But in normal circumstances, all database interaction would be done through your code, which means you can setup your own triggers if certain things in the database are changed.

Be sure to look into Laravel’s Events system.

Yes, it will. Any web request (and especially any PHP execution) consumes server power, and this includes executions triggered with a cron job.

But it’s no worse than if you accessed the URL by hand, so don’t be too worried about it.

By default, Laravel uses disk cache. Redis or Memcached are also supported, but not enabled by default, and you need to have a separate Redis/Memcached server running to be able to use it. And we don’t have that.

Static files like images and CSS are just plain files stored on disk, and reading and serving those files is an extremely simple and fast operation. Our servers don’t cache these files because that would just make everything worse, and you should definitely not cache it with PHP because that’s much slower.

I’m not sure. It might be, but .htaccess rules aren’t easy to read.

I’ve had good results with this one though.

6 Likes