Cache Driver for production site
Hi all, i noticed that the default setting for
.env. I thought the usual default for Laravel was
file, has this been set to
Anyway, I tried changing it to
fileand got "This cache store does not support tagging.". I cleared cache etc, so assume this is a package used by Asgard which doesn't support file caching.
What does everyone use for their cache driver in production? I'm looking at installing Redis on my VPS. Never done it before, so any tips, help etc would be appreciated.
That's the reason array is the default, file driver doesn't support cache tags. Cache tags is not an asgard feature btw.
Production should use redis or similar though.
Thanks. I've installed and enabled Redis. Not seeing much performance boost though. My TTFB is > 600ms - is that normal for Laravel/Asgard? Can you suggest any ways to improve performance? I haven't added much custom code, database is pretty much fresh apart from several pages. Nothing more going on in the app other than Asgard.
That depends on your server. Asgard is below 300ms on the cheapest digital ocean server.
Strange, I have a VPS, 2 cores, 4GB RAM, but still only getting 600+ms. I have set up blackfire on the server, and it is reporting that
Composer\Autoload\includeFileis taking a total of 250ms on its own (over 299 calls).
Illuminate\Container\Container::buildis also being called 141 times with total time of 49ms.
Does this seem normal to you? Do you have any ideas of how to reduce these?
That's how composer works yes.
Did you run
composer dump autoload -o, to optimise the autoloader?
Hi @nWidart - thanks, I hadn't run it no, but now have on the VPS and still not much difference - 296 calls, 236ms...!
Does this mean I can enable laravel cache to use memcached as well if I change cache_driver to use memcached? My server supports both redis and memcached, but I want to try out memcached first and then redis and compare the performance at the last.