2

Sorry if this seems trivial, but I need to be sure:

Where does Laravel 6 store the view cache? On the cache server or in the storage folder?

Does it get stored in my redis if I set it as the cache server?

Dave M
  • 4,494
  • 21
  • 30
  • 30

1 Answers1

3

The view cache is always stored via the filesystem in storage/framework/views.

You can verify this by setting your cache to something like Redis, doing php artisan view:clear, and observing that folder after visiting a couple Blade views in the browser. Files will show up even when you're not using the file-based driver.

If you're on a multi-server load balanced setup, be aware this means you'll need to clear the view cache on each server independently. (Probably as part of your deployment process.)

ceejayoz
  • 32,469
  • 7
  • 81
  • 105
  • Thanks Mate! How about if I create a fileserver with a shared storage folder, so the two or more webservers will have the exact same content in the storage folder? –  Jan 16 '20 at 08:14
  • @ImreBertalan I think that'd be adding needless complexity and a big single-point-of-failure. There's no real downside to the filesystem cache for views - it's going to be faster than any of the other cache drivers, and clearing it on deployment is easily automated. – ceejayoz Jan 16 '20 at 13:55