#Coding style for caching

1 messages · Page 1 of 1 (latest)

undone rose
#

Hey everyone, I'm new to caching in Laravel. I want to implement backend caching for expensive data fetching operations.

For example, I have this method called getBootOrder in https://github.com/ConvoyPanel/panel/blob/develop/app/Http/Controllers/Client/Servers/SettingsController.php#L92
(the link will jump to that code block)

and the data fetching operation is expensive because it has to also send another request to another API and then do a bunch of "stuff" to filter out the device list and yada yada.

I want to know if there is a standard or universal style for utilizing caching in the code, like placing calls to the cache (Cache::get, Cache::set) in a service container or the controller.

Basically, I want to know if there is an optimal and acceptable usage of caching (that would also not conflict with tests as I'm interested into getting into that)

GitHub

Convoy aims to be a scalable, reliable panel better than most solutions on the market made for selling virtual machines. It works by utilizing Proxmox's API to automatically manage/deploy v...

#

In addition, there are times when I want to bypass the cache to obtain the "freshest" value